Tuesday, July 8, 2008

Testdriven.NET and Ad Hoc testing

Since I am fairly new to C# I still make a lot of syntactical mistakes. One of the features I love about Testdriven.NET is the ability to run Ad Hoc tests on a newly created method to make sure it will actually run. This is by no means a replacement for proper Unit Tests but it does at least tell me if I made a mistake with the code that would prevent it from building without going through the entire process of actually building it.

To run an Ad Hoc test add MbUnit as a reference to your current project.
Then create a method. Once the method is "complete" right click anywhere inside the method and select Run Test(s).

I am using the default setup for Visual Studio and Testdriven.NET. This will allow Testdriven.NET to show the output in the "output" pane.

No comments: