Darkbound
Darkbound

Reputation: 3434

How can I output results of tests ran with NUnit 3?

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.

What should I do in order to make NUnit 3 produce the results file or what and where should I be looking for?

Upvotes: 4

Views: 5899

Answers (1)

petah
petah

Reputation: 330

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

From a CMD/PowerShell console, 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.

Upvotes: 3

Related Questions