Monday, April 04, 2005

NUnit, debugging your test code

When using Test driven development for developing libraries, the code that you develop are usually accompanied by test code written to test your production code. So at times you might need to set breakpoints to debug the test code you write. The easiest way to do this is change the debugging option of your test project by setting the Debug Mode as "Program" and the Start Application to the NUnit GUI in the project configuration. So the next time you run your class library containing the test code in debug mode the NUnit GUI will be invoked. When the tests are run the code will break properly at the set breakpoints.
All this time i was attaching the debugger to the NUnit GUI process when i wanted to debug my test code but setting up the project configuration to invoke NUnit GUI seems like a better approach.

No comments: