How to output results of tests ran with NUnit 3?

梦想与她 提交于 2020-01-04 09:14:32

问题


Since yesterday I am trying to figure out how to create that xml report that NUnit3 can produce and I just can't find a single example with code, could anyone tell me what should I do in order to make NUnit3 produce the results file or what and where I should be looking for?

Thanks!


回答1:


This can definitely be done using nunit3-console.exe to run your project.

From cmd/powershell call \path\to\nunit3-console.exe \path\to\your.dll. A TestResult.xml file is created in \myProjectFolder\bin\Debug by default. You can also add the -out= flag to additionally create a custom log.

For instance \path\to\nunit3-console.exe \path\to\your.dll -out=\path\to\whereever\testResultFileName.xml. With a simple project have a [Test] and a Console.WriteLine(). The testname and print statement will show up in your custom file.



来源:https://stackoverflow.com/questions/43341184/how-to-output-results-of-tests-ran-with-nunit-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!