$ cat "

Debugging NUnit Unit Tests in Visual C# Express 2008

"

Since Visual C# Express does not allow add-in:s, and attach to process is not available, you have to roll your own simple test runner if you want to be able to debug your unit test.

Fortunately this is quite simple. The easiest way, in my opinion, is to add a new Console Application project to your solution. Add a reference to nunit-console-runner.dll, and then add the following code to the main of the new console app:


Set the console app as start up project by right clicking the project in the solution explorer and choosing "Set as start up project".

You can now set break points in your test code and simply hit F5 to debug the tests.

Written by Erik Öjebo 2008-11-13 15:42

    Comments