December 2005 - Posts

The DuckUnit Extensibility Sample

A little while ago I was working on an example that demonstrates the TestDriven.NET extensibility model. It was an example of how to use the TestDriven.Framework.ITestRunner interface which enables native support for different unit testing engines. This is what NUnit, MbUnit and (soon) Zanebug use allow their test types to executed using TestDriven.NET. The Visual Studio Test Tools (VSTT) support uses a deeper extensibility interface which I'll discuss in a future post.

I started off by writing a minimal unit testing framework and enabling support for that. In the end I decided this was too boring and I should enable support for something a little different. This was when DuckUnit was hatched (sorry). DuckUnit allows you to mark methods as being tests using a simple XML documentation element. It also allows you to specify multiple rows of arguments and expected return results.

Remember it is just a sample at the moment. Simply open the project and run the example tests. It uses [assembly: CustomTestRunner(typeof(DuckUnit))] so that it knows to use a custom test runner (rather than one of the plug-in ones). This is an easy way to develop custom runners without having to worry about installing anything in the registry. I'll mention the registry entries another time.

Anders NorĂ¥s discovered DuckUnit in my 'TestDriven' shared folder. Rather than duplicate what he said, you can read a little more about it and where he found it here.

Posted by Jamie Cansdale | with no comments
Filed under:

Test With... Application

You may be wondering where the 'Test With... NUnit GUI' option has disappeared to in recent builds. I have been working on opening this up so that other test framework providers can include their GUI test runner as an option. In the current build this menu will be auto populated when TestDriven.NET is activated in the Visual Studio process. This means you won't see these options until TestDriven.NET has been activated on demand (you have used one of TD.NET's other buttons) or 'Startup' is checked in the 'Add-in Manager'. The easiest way to 'fix' this would be to install with the activate on start-up option on by default. I'm reluctant to do this however because I don't want to slow Visual Studio's start-up by even a fraction of a second!

You can see below there are options to run the MbUnit or Zanebug GUIs. If you've subscribed to the 'TestDriven' folder in FolderShare you can obtain the latest MbUnit installer from the MbUnit directory. I've been working with Sean McCormack on Zanebug integration and I'm hoping there will be something ready in a week or so. How about it Sean?


Note: The application icons only appear on the 'Solution Explorer' project menu.

Posted by Jamie Cansdale | 1 comment(s)
Filed under:
More Posts