Andrew Stopford's Weblog

poobah

News

Articles

Family

Old Blogs

Microsoft MVC and MbUnit

You may recall ScottGu's post about the new feature in latest drop of the MS MVC framework that allows you to pick your unit test framework of choice. With Mix08 now wrapped up and the framework released I can show you what the MbUnit templates look like. You will need either MbUnit 2.4.2 or MbUnit 3.0 alpha 2, early previews of these are available if you really like the edge, but more stable drops are coming, with 2.4.2 installed here is what you will see.

When created you would see


The test project depends on the name of your project, for example "myproject" would be "myprojecttests" etc. The project is preloaded with your main project and a referance to the MbUnit.Framework dll. For the moment we have a default test for the controller, which looks like.

using MbUnit.Framework;

[TestFixture]
public class HomeControllerTests
{
    [Test]
    public void About()
    {
        //
        // TODO: Add test logic here
        //
    }
    [Test]
    public void Index()
    {
        //
        // TODO: Add test logic here
        //
    }
}
 
Notice default tests for your about and index page, these match the default about and index controllers. The template only referances what you need so you don't need to refactor out any unrequired referances.

Note that the MVC team has blogged about how to add and use NUnit templates including NUnit\Rhino templates. To save you some steps we have added the templates to the installers, I did an inital drop of the template but Jeff did all the work to make this happen and we would welcome your feedback.

Comments

Brad Abrams said:

Phil has some good thoughts on ASP.NET MVC preview 2 and beyond.   A couple of key things that I

# March 10, 2008 10:35 PM

Noticias externas said:

Phil has some good thoughts on ASP.NET MVC preview 2 and beyond.   A couple of key things that I

# March 10, 2008 11:34 PM

Jeff Brown said:

Thanks Andy.

Besides the MVC templates, I also added ordinary templates for test projects and test fixtures.  Check 'em out!

# March 11, 2008 1:14 AM

MSDN Blog Postings » ASP.NET MVC in CodePlex and Extensible Unit Testing said:

Pingback from  MSDN Blog Postings  » ASP.NET MVC in CodePlex and Extensible Unit Testing

# March 11, 2008 1:14 AM

Programming said:

Phil has some good thoughts on ASP.NET MVC preview 2 and beyond.   A couple of key things that I

# March 11, 2008 1:20 AM

Dew Drop - March 11, 2008 | Alvin Ashcraft's Morning Dew said:

Pingback from  Dew Drop - March 11, 2008 | Alvin Ashcraft's Morning Dew

# March 11, 2008 8:38 AM

Enlaces: ASP.NET, ASP.NET AJAX, ASP.NET MVC y .NET « Thinking in .NET said:

Pingback from  Enlaces: ASP.NET, ASP.NET AJAX, ASP.NET MVC y .NET « Thinking in .NET

# March 16, 2008 7:16 PM

Exploring the ASP.NET MVC Preview 2 - First Glance « Ramblings of the Sleepy… said:

Pingback from  Exploring the ASP.NET MVC Preview 2 - First Glance « Ramblings of the Sleepy…

# March 21, 2008 2:06 AM

php code and scripts » Blog Archive » Exploring the ASP.NET MVC Preview 2 - First Glance ?? Ramblings of … said:

Pingback from  php code and scripts  » Blog Archive   » Exploring the ASP.NET MVC Preview 2 - First Glance ?? Ramblings of …

# March 21, 2008 2:50 AM

Mark said:

Hey I just gave this a shot but don't get mbunit as an option.  I'm using visual web developer though, are there any templates available for it?

# June 13, 2008 8:14 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)