Creating NUnit projects


Since version 2.1, both the Console runner and the GUI runner of NUnit can load tests from multiple test assemblies. The NUnit documentation contains more information about this feature. Still there can be one or more obstacles when you use multiple test assemblies.

Adhoc projects

The Console runner accepts more than one test assemblies as command line arguments. If you use the GUI runner you can add test assemblies by using “Project => Add Assembly…”. But the test assembly must be in the same directory as the assembly which has already been loaded, otherwise NUnit can’t find the file and aborts with a FileNotFoundException.

Creating NUnit projects

You can create a new NUnit test project by clicking on “File => New Project…”. You can add assemblies to the project by clicking on “Project => Add Assembly…”. Using NUnit test projects the test assemblies can be in different directories.

One configuration file for all test assemblies

NUnit can load configuration files for test assemblies even for class libraries. With NUnit test projects you can use just one configuration file. You can change the name of this file in the NUnit project editor, but you can’t specify a file path, just the file name. The configuration file must be located in the same directory as the project file.

Leave a Reply

Your email address will not be published.