2
votes

I am running VS2008 with Resharper 4.1, NUnit 2.2.7, coding in c#.

I would like to use an NUnit unit test as a debugging harness while I am developing the code.

My test is in a different project than the method being tested, but in the same solution.

I have put breakpoints into the unit test as well as the method being tested. VS is set to Debug.

When I run the unit test thru resharper (also choosing the debug option) the code where the breakpoint is set flashes on the screen, but does not pause and let me look at the values of variables.

What step(s) am I missing?

1
"VS is set to Debug." - this means, that VS will use debug configuration for building your app and not that it will automatically run debugger.Arnis Lapsa
Is the line with the breakpoint actually being executed? If the breakpoint is on a line of code not being executed then the breakpoint won't be hit.JB King
"code flashing" does not guarantee hitting a breakpoint. It is just that VS switches window layouts when going to and out of the debug mode.Rinat Abdullin
Thanks, JB. That was it. An exception was being thrown before code with breakpoint got exceuted. Yup, and I know - first the unit test is supposed to fail.Lill Lansey

1 Answers

2
votes

Left-click on the green symbol that shows by test methods and hit "Debug"

Alternatively you can select unit tests in "Unit Test Sessions" right-click and select "Debug Selected Tests".