The TestDriven.NET Quickstart: Not So Quick

So I’ve started playing with TestDriven.NET, a Visual Studio Add-In that lets you run NUnit by right-clicking and choosing Run Test(s).

There’s a Quickstart page to get you up and running, but some details were omitted:

  1. Your project needs a reference to nunit.framework.dll, probably located in
    C:\\Program Files\\TestDriven.NET 2.0\\NUnit\\2.4
  2. Add this to the top of your file:
    using NUnit.Framework;

    If you want to use the nifty Assert.That(foo, Is.Not.EqualTo(bar)) syntax, also add

    using NUnit.Framework.SyntaxHelpers;

If you don’t do that, when you try to Run Test(s) you’ll get

The type or namespace name 'Test' could not be found
 (are you missing a using directive or an assembly reference?)
The type or namespace name 'TestFixture' could not be found
 (are you missing a using directive or an assembly reference?)

Some of you are thinking “Well, duh,” and in general I’d agree, but the QuickStart really ought to mention it. Since all it says is to right-click and run the tests, I initially thought something had gone wrong during the installation.

Bonus Linkage for Nifty Syntax: Troy DeMonbreun’s Learn the new NUnit 2.4 Constraint-Based Assert Model, is a handy quick-reference.

Comments are closed.