Stop procrastinating...download TestDriven.NET already!

I've written about this add-in before, but I frequently run into .NET developers who are attempting test driven development without using the free TestDriven.NET Visual Studio .NET add-in.

I've basically always used TestDriven.NET (formerly NUnitAddin) to do unit testing within VS.NET so I wonder, do most developers try to switch between VS.NET and the NUnit GUI to run the tests occasionally? I dislike context switches like that. To debug, wouldn't you have to attach the debugger to the NUnit GUI process? Yikes. Anything that adds extra steps into the edit-compile-debug cycle is just friction.

Here are two observations:

  • Optional things that add friction to the development cycle are eventually going to be skipped.
  • Unit tests don't do any good if they aren't run.

Save yourself some time and don't bother writing the tests in the first place if you aren't going to run them regularly. Ideally with every build, but that's a different topic.

With the TestDriven.NET add-in you just code up a test like you always did (we use NUnit), right click on the test method right there in your code editor and select Run Test. The tests are run and results reported right there in your Visual Studio output window. If you have a failed assertion, double click it in the output window and it takes you right to that line in the test. Can you get any less friction than that?

If you want to run all of the tests in the namespace, right click on the namespace, if you want to run all of the tests in a project, right click on the project in solution explorer. If you want to step through your test in the debugger, right click and select Test With Debugger. That's about all you need to know about it...it just works.

Do yourself a favor and download this free tool if you haven't already.

3 Comments

  • Only problem is there aren't enough keyboard shortcuts. I cannot find one for simply running all the tests in my current project. So my "No Mouse" workflow gets thrown for a loop, which I dislike. Better than NUnit GUI most of the time, though I miss my green bar.



  • > wouldn't you have to attach the debugger to the NUnit GUI process?

    No, just specify NUnit-GUI.Exe as the Start Application for the class library with your unit tests, and you can debug happily from within the IDE.



    Your post prompted me to try TestDriven.NET, but all my tests failed because no application configuration file was available. How can I tell TestDriven.NET to use an application configuration file?

  • i wnt a tool for testing .net

Comments have been disabled for this content.