10.8 Integrating Unit Testing into Visual Studio with TestDriven.NET

The problem with most unit-testing tools is that they are standalone applications, requiring you to switch back and forth between the IDE in which you write your code and the tool you use to test it. This is especially time-consuming when practicing test-driven development, as you have to switch between your IDE and the testing GUI multiple times for every method that you write.

TestDriven.NET is a Visual Studio add-in that integrates unit-testing functionality directly into Visual Studio. You are no longer forced to switch to another application to execute your tests—you can run tests and view results directly inside Visual Studio. TestDriven.NET works with NUnit, MbUnit, and the testing framework built into Visual Studio Team System editions.

TestDriven.NET also includes features to debug tests, examine code coverage, compile and run tests in .NET 1.1, and run “ad-hoc” tests.

Tip

Shortly before this book went to press Jamie Cansdale, TestDriven.NET’s creator, changed the release model for the tool. TestDriven.NET now comes in two commercial variants, Professional and Enterprise. There is still a free version for hobbyist developers, but using TestDriven.NET on any commercial project requires you to purchase a commercial license. See the tool’s home page for more details.

TestDriven.NET at a Glance

Tool

TestDriven.NET ...

Get Windows Developer Power Tools now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.