O'Reilly logo

Professional ASP.NET MVC 3 by K. Scott Allen, Brad Wilson, Phil Haack, Jon Galloway

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a Unit Test Project

The MSTest unit testing framework is included with all paid editions of Visual Studio 2010 (it is not included in Visual Web Developer Express 2010). Although you can create unit test projects directly inside of Visual Studio, it can be a lot of work getting started with unit testing your MVC application. The ASP.NET MVC team included unit testing capability in the New Project dialog for MVC applications, as shown in Figure 12.1.

By selecting the Create a Unit Test Project checkbox, you're telling the ASP.NET MVC New Project Wizard to not only create an associated unit test project, but also to populate it with a set of default unit tests. These default unit tests can help new users understand how to write tests against an MVC application. (If the checkbox isn't enabled, make sure you've selected either the Internet or Intranet template; there is no associated unit testing project for the Empty project template.)

Third-Party Unit Testing Frameworks

The Test Framework combo box on the ASP.NET MVC New Project Wizard allows you to select which unit testing framework you'd like to use. For users with the paid editions of Visual Studio, this will include a combo box, Visual Studio Unit Test, designed to be supplemented by third-party unit testing frameworks; for example, the xUnit.net unit testing framework (available at http://xunit.codeplex.com/ ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required