Here are the steps to attach Visual Studio debugger to the NUnit GUI test runner process. Attaching the debugger will allow you set breakpoints and debug NUnit test code in Visual Studio IDE.
- Right click the Project in the solution explorer
- Select “Start external program”
- Right click the Project in the solution explorer
- Click properties
- Click the ellipses “…” button
- Find and select the NUnit GUI test runner “c:\yourpath\nunit-x86.exe”
- Type the name of your test dll in the “Command line arguments: “ textbox
- Run the project and if its configured correctly the NUnit GUI runner should appear with the test dll loaded
I wrote this because today I ran across someone who decided to rewrite there test suite in MSTest because they couldnt debug or use break points with NUnit... By the way, friend don't let friends use MSTest for functional tests. More than once I have run across developers or testers who didn't know how to do attach the debugger and its very simple. Perhaps the funniest occasion was on a 3 month contract with eTouch, the developers there created a separate command line (exe) project that executed the NUnit test runner passing in there dll.
To get the Break points & Edit and Continue to work in .NET 4.0 you need to edit the nunit-x68.config file (or witch ever config of the exe your using to execute the tests)
To get the Break points & Edit and Continue to work in .NET 4.0 you need to edit the nunit-x68.config file (or witch ever config of the exe your using to execute the tests)
<startup>
<requiredRuntime version="4.0.30319" />
</startup>
No comments:
Post a Comment