问题
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