Reputation: 397
Is there a way to export the result of a unit test?
When I run NUnit, can I get formal output saying what methods have been tested and out of those, which one failed and which passed?
Upvotes: 2
Views: 3679
Reputation: 5445
You can specify the test results to be outputted to a file:
Redirecting Text Output
Output created by the test, which is normally shown on the console, may be redirected to a file. The following command redirects standard output to the file TestResult.txt:
nunit-console nunit.tests.dll /out:TestResult.txt
The following command redirects standard error output to the StdErr.txt file.
nunit-console nunit.tests.dll /err:StdErr.txt
Note:This option only redirects output produced by the tests, together with selected NUnit output that is interspersed with the test output. It does not redirect all console output. If you want to redirect all output to a file, you should use command line redirection as supported by the shell you are using. This option exists for the purpose of separating test output from other output, such as the NUnit summary report.
From the NUnit documentation.
I just tested against one of my test assemblies by completing the following steps:
The results were then written to TestResult.txt in the same directory.
Upvotes: 2