NUnit Testing with visual studio - how can I throw exception at point of failure?

125 Views Asked by At

I'm trying to write some tests in NUnit and running them through the VS Test Explorer.

If my test code throws an exception it seems it is just swallowed up, even when I run the test in Debug mode.

For example, if a NullReferenceException happens in my test code, the test just fails and I often have no way of knowing which line caused the failure, so I'm forced to step through the test code line by line until the test fails.

This is no way to live, I want the test execution to be paused and the exception to be thrown right there on that line that caused the NullReferenceException, just like when debugging regular code.

Is this possible with my setup? I would like to continue running tests through VS Test Explorer, but have them behave like any other code, throwing exceptions at the point of failure.

0

There are 0 best solutions below