Project Description
MSMSpec autogenerates MSTest tests corresponding to MSpec tests. Useful where MSTest integration is desired / required / forced. Also enables using VS test tooling for MSpec tests. Requires VS2010 and .NET 4.0.

Tired of having MSTest forced upon you for whatever reason? This lets you create MSpec tests, use whatever runner you choose and still integrate with MSTest. Or perhaps you don't like having to set up resharper / TDD.NET or VS external tools for MSpec. This lets you use Visual Studios test buttons and menus to run your MSpec tests. Features like "Run Tests in Current Context" become available and debugging becomes trivial.

Current Features
1. Single T4 file that can be added to a dll project.
2. Generates a test runner to work around MSTest's pseudo threaded executor. This can be turned off in individual T4 files in case you have one test assembly reference another one.
3. Generates nested *.mstest.cs files with MSTest partial classes for each MSpec test. Marks original test class as partial.
4. Supports It, Because, Establish, Cleanup, Ignore - even in derived test classes. Does NOT support behaviours.
5. Marks project as an MSTest project if it was not so already. If marked, subsequent project loads will show MSTest testing icons in Visual Studio, which can be clicked to run all tests, debug tests etc. No additional test runner (like resharper, TDD.NET) or external tool set up necessary.
6. Adds a reference to the VS unit test dll. This is obviously done a maximum of once. If it the reference is added, you will likely need to reload the project (or simply close and open the solution) for the VS test icons to appear.
7. Only supports VS2010, C# and .NET 4.0.
8. REQUIRES a reference to the MSpec dll to be present to work. This should be set automatically by the NuGet package.
9. NuGet package available. If package is not available, simply adding MSMspec.tt to the root of your project (that has a reference to Machine.Specification.dll) should produce the same results.
10. Tries to play nice with VS source control plugins although this hasn't been tested thoroughly. I highly recommend the use of Chirpy to run the T4 on each build. If you use a proper source control like mercurial or git (ahem not TFS), this should work fine. It might also work file for TFS, although I don't know (yet) if the readonly issue is going to be a problem.
11. Some advanced or non-conventional uses of MSpec might not work. Behaviours are not supported in this release (and they may never be supported as I don't use them).

Last edited Mar 8, 2011 at 1:05 AM by HeartattacK, version 5