O'Reilly logo

NUnit Pocket Reference by Bill Hamilton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Test Runner Console

The test runner console is text-based and not interactive. It is most useful in automated testing environments where you use an automated build tool, such as NAnt, to run NUnit tests automatically as part of the build cycle.

The test runner console has a number of options in addition to those available in the test runner GUI. The console interface outputs test results to an XML file. By default, the file is named TestResult.xml and is placed in the working directory. This XML file is overwritten without warning if it already exists. The schema and contents of the file are described earlier in "Results in XML format."

To use the test runner console, add the directory for nunit-console.exe (the default directory is c:\Program Files\NUnit V2.2\bin) to the environment path by selecting Control Panel→System, selecting the Advanced tab, and clicking the Environment Variables button. Append the directory containing nunit-console.exe to either the user or system path. Separate the path from any other entries with a semicolon.

Test an assembly by specifying its name on the command line:

nunit-console.exe NUnitPocketReference.dll

The output includes:

  • Output that you have directed to the console in the tests. This output is the same as that sent to the Console.Out window in the test runner GUI.

  • Statistics about the tests run including the number of successes, failures, tests not run, and the time it took to run the tests.

  • A list of tests that failed.

  • A list of tests that were ignored. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required