Game Development Reference
In-Depth Information
For example, SimpleLibrary.UnitTests.dll and SimpleLibrary.UnitTests.dll.config
should be paired together in the same folder.
Debugging with Visual Studio
There may be times when you wish to debug the code while performing unit tests,
and sometimes you may even want to debug the unit tests themselves. NUnit and
Visual Studio both execute code in different AppDomains , so any breakpoints you set
in the Visual Studio IDE will not fire when NUnit is run. There is a trick you can
use to accomplish this, though. Visual Studio offers the ability to attach external
programs to its debugging features when assemblies are consumed.
Open the property pages for the assembly you wish to consume externally, and
navigate to the Debug page in the project properties. You should be presented with
a dialog similar to the one shown in Figure 10.6.
Figure 10.6 Debugging property page.
Under Start Action, select the Start external program option, and set the field value
to the file system path of either the GUI or command line executable of NUnit.
You must specify the assemblies to load in the command line arguments; otherwise,
NUnit will launch with the last loaded project if there is one. Each assembly path
should be separated by a space, and be sure to use double quotes around the path
if spaces exist in it. You can alter the command line arguments to automatically
start running your tests after NUnit opens. If you prefix the arguments line with
Search Nedrilad ::




Custom Search