Machine.Specifications under TFS 2012

About year ago we started to use Machine.Specifications (screencast) on one of our projects. It was really nice to have executable specifications and well organized tests. The only issue was is that TFS 2010 Build wasn’t able to run Machine.Specifications. Finally I’ve added some T4 templates to create MSTest wrappers for MSpec code. So we were able to run our tests and see the coverage on the CI server.

What’s amazing TFS 2012 support test runner extensions. Hence now we can easily configure our CI server to run Machine.Specifications and show us the code coverage!

The step by step guide for NUnit available at http://blog.accentient.com/2012/04/30/RunningNUnitInATFS11BuildOn64BitServer.aspx. For the Machine.Specifications it’s pretty much the same. The only change is that you’ll need to install MSpec Test Adapter instead of NUnit. Also please make sure you selected Visual Studio Test Runner in the build configuration.