Using NUnit with Visual Studio 2008 Class Library


Class library are a bit harder to debug compared to dialog based or command line based application. After deciding to use NUnit I was using a dialog based application to instentiate my class library debugging, however there is a much easier way of doing that

1) Create class library with unit tests

2) Take properties of the class project in visual studio, and select the debug tab. properties -> debug

3)  Set Start external program to C:\Program Files\NUnit 2.4.1\bin\nunit.exe or whereever you nunit executable is placed.

4) Set the test library as startup project.

5) Start debugging the project, it will bring up the nunit test application, if there are breakpoints in the application it will break into it.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s