I’ve been getting a lot of questions regarding VstsUnit for ReSharper 3.0. I’ve got good news and bad news.

First the bad news… I’ve been working on it off and on, though it’s offering some significant challenges. The object model is completely different and tests are executed in a dedicated test runner that ReSharper spins up. So test exploration is working, but test running is failing mysteriously without a good way to debug. The problem… I haven’t been able to connect to the transient process with a debugger – even with Debugger.Break(); in the test runner code.

Second piece of bad news… I’m trying to wrap my head around the new test running model in ReSharper. As far as I understand the new API, you get a call per test to run rather than the complete list. I’m not sure if this is going to be workable at all with VstsUnit due to unnecessary limitations imposed by Microsoft. The entire VstsUnit testing API is marked internal with [InternalsVisibleTo(MicrosoftPublicKey)]. So the only way to run the tests is through mstest.exe.

Third piece of bad news… After much struggling, VstsUnit doesn’t work for me for a whole variety of reasons. NUnit and MbUnit are just frictionless by comparison. When I absolutely must run VstsUnit (or NUnit/MbUnit), I’m using Jamie Cansdale’s TestDriven.NET. Not as pretty as the ReSharper Unit Test Explorer, but much more functional. Highly recommended.

The good news… For those of you who wish to continue using ReSharper’s Unit Test Explorer, I’ve released the source code on Google Code for both the ReSharper 2.5 and 3.0 versions. You can find it under vstsunit-resharper. If you have time and interest to work on this project, please drop me an email. I’m accepting patches… Open-mouthed I’m also releasing the code under The BSD License, which means that if JetBrains wants to grab the code and incorporate it directly into ReSharper, they are more than welcome to it!

N.B. Due to redistribution restrictions, I cannot place the required Visual Studio and ReSharper DLLs into the Subversion repository. You will need to copy the files into lib\ReSharper and lib\VisualStudio. See the Readme.txt files in these directories for more information.