Stopping on Failed Assertions

After reading the following entry in Dejan's weblog, I decided to see it if what he suggests is possible using NUnitAddin.

Unit Testing Frameworks [Dejan's Weblog]

Something strikes me as extremely wrong with all these unit testing frameworks that are popping up all over the place: they all provide an indication of how many tests have passed and failed. Huh? What's the purpose of that? When a unit test fails, I want the test execution to immediately stop in the debugger at the offending line so that I can see where the problem is. To do anything else is a lack of good sense.

Goto 'Exceptions...' on the 'Debug' menu. Select 'Common Language Runtime Exceptions' and 'Add...'. Add a new exception called 'NUnit.Framework.AssertionException'. Select 'When exception is thrown: Break into the debugger'. The debugger is now configured to stop on failed assertions. Next goto 'Debug Tests' on the 'Tools' menu. A new test process should launch with the debugger attached. You're now ready to start running tests (individual or all in project/solution). When an assertion fails, the following dialog should appear...

1 Comment

Comments have been disabled for this content.