Search code examples
asp.net-mvcvisual-studiomspec

MSpec and ASP.NET MVC Unit Test, Visual Studio Integration


When one creates a new ASP.NET MVC project in visual studio, the New Project Wizard provides the option to create a unit test project at the same time. Typically, the only choice offered is MSTest, but I want to use MSpec. MVC is supposed to be pluggable, including for unit test frameworks, so I'd really like to be able to choose 'MSpec' from that wizard and have my MSpec project created alongside the MVC project.

Is anyone aware of an MSpec integration that's been done that lets users get going with MSpec right from the New Project Wizard?


Solution

  • There's no integration for the new project wizard as of today.

    Creating a MSpec test project ist easy, so I would argue that there's no real benefit in having a new option in the project wizard:

    1. Download MSpec from the TeamCity server at CodeBetter
    2. Extract the zip file to your project's lib or tools folder
    3. Create a new class library and reference Machine.Specifications.dll
    4. Write specs
    5. Run tests with ReSharper or TestDriven.Net (or use the console runner, but that's not really preferred)