views:

136

answers:

3

I have written a NUnit test in Visual Web Developer 2008 Express. But when I run the test, it doesn't pause at the breakpoint I had set. It just keeps on running but at the breakpoint, I need a step-by-step view on the test.

Could anyone please tell me how I can use breakpoints with NUnit?

Thanks in advance!

A: 

I assume you are running NUnit from outside Visual Studio, since the Express versions do not support Plugins. I don't think you can debug NUnit tests that way. If you had a non-Express version you could use the testdriven.net-plugin for debugging. Maybe if you set the NUnit runner as program tu execute on debugging with you assembly as command line parameter...

EricSchaefer
A: 

A little more information on what you're trying to do would help, but in general, if you're setting your breakpoints in the actual test code, then you have to execute the test-runner in the debugger.

Matt Enright
Well, to clarify my question:My test uses my program code. Everything is written in Visual Studio Web Developer 2008 Express Edition. At a certain point, i have a statement:prod=mpp.Productivitywith a breakpoint.Now I want to run the test, but effectively use the breakpoint. A few step-by-step executes and then run the test until it's done. But instead of pausing at the breakpoint, my test runs all the way through and I want it to stop at the breakpoint so I can do some step-by-step debugging...
Bart Van Eyndhoven
Is your test code in the same assembly as the program code? Either way you are going to need to run nunit in the debugger, since that's what picks up the breakpoints and allows you to step execution, edit locals, etc., but depending on your debugger you may need to modify the settings to be able to step through code in an external assembly.
Matt Enright
+1  A: 

This is how you do it... - http://codebetter.com/blogs/paul.laudeman/archive/2004/03/18/NUnit-Tip_3A00_-Debugging-your-unit-tests.aspx

However I'm not sure if Express editions of VS support 'start external program' for debugging / 'attaching to a process'. In which case, you may need to upgrade to be able to debug.

Gishu
Doesn't look good... - http://msdn.microsoft.com/en-us/library/68c8335t.aspx
Gishu