Sunday, September 30, 2007

I have been using MbUnit's AutoRunner a lot lately and it rocks. To use the AutoRunner add a new class to your test project named SelfTester with the following code:

public class SelfTester
{
    public static void Main()
    {
        using(AutoRunner runner = new AutoRunner())
        {
            runner.Load();
            runner.Run();
            runner.ReportToHtml();
        }
    }
}

Next right click on your test project and set it as the start up project. Change the output type to Console Application and the startup object to your SelfTester class:

SelfTester

 Now hit F5 and your test results will appear in a nicely formatted html page. This works even if all your tests are written using NUnit as the framework. It does not however work with MSTest.

 

Now Playing: The Chemical Brothers - We Are The Night - All Rights Reversed

Sunday, September 30, 2007 6:17:03 AM (GMT Standard Time, UTC+00:00)  #    Comments [1]  | 
Sunday, September 30, 2007 3:45:20 PM (GMT Standard Time, UTC+00:00)
The MbUnit team should add a static method (TestMain) or something that wraps this code so you really have to write a single line only...
Name
E-mail
Home page

Comment (Some html is allowed: a@href@title, strike) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

Enter the code shown (prevents robots):

Live Comment Preview

Theme design by Jelle Druyts

Pick a theme: