Question

I've fixed a null reference problem. Now when I run the test related to that class, it fails. I'd like to know whether is possible to run a test in debug mode so I'll know why I am getting the exception?

The test was written by some else, it's calling a method, as part of the setup, with a lot of logic in it. I'd like to step in to see how values are being returned.

Thank for helping.

Était-ce utile?

La solution

It is indeed possible, using the NUnit Test Adapter for Visual Studio 2012.

Also, just so you're aware: failed assertions will throw exceptions, causing the debugger to break execution. You can adjust your configuration to work around this, as described in this thread:

Debugging in VS2012 with NUnit without throwing exceptions?

Autres conseils

You can also use ReSharper, which makes it pretty easy. Or, you can just go into the properties for your DLL project that has the test in it and make the test runner you are using the exe that runs when you run the project.

Right click the project in the solution explorer, select "Properties" from the menu, go to the "Debug" tab, click the "Start external program" radio button then set the project as the active project and run in debug mode.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top