I just happened to look at the MSTest API today trying to get a feel for whether there were any nicer points of integration other than wrapping MSTest.exe.
Internals All The Way Up
Along the way I happened to notice that the Microsoft.VisualStudio.QualityTools.Common assembly has 166 InternalsVisibleTo attributes on it!
All of the useful API for loading and running tests is internal. It's possible to create new test types but it does not seem possible to manipulate the test execution pipeline at all. The good parts of the internal Tmi class are locked away and inaccessible through the public ITmi interface. I don't see any other API that provides access even indirectly to the LoadTests methods except for the console application. Disappointing.
Alright Microsoft, I get the message: Keep out. Fine!
Avoid MSTest
If you are currently considering adopting MSTest internally, I strongly recommend you choose more open/extensible tools instead. Microsoft is deliberately curtailing the ability of third-party tools integrators to extend their offerings in all but the most trivial ways. This will ultimately limit the kind of support you will be able to receive long-term from the developer community.
Vendor lock-in is not good for anyone.
