JetBrains recently released an EAP of dotCover 2.0. Up until now, dotCover required ReSharper to enable code coverage of unit tests – it integrated itself nicely in the ReSharper menus and UI, and would provide a coverage analysis of the code executed during a test run.
Starting with this 2.0 EAP, you no longer need ReSharper installed. DotCover provides support for its own test runner and test runner plugins. In fact, it comes bundled with a port of the unit test support and framwork from ReSharper, so you won’t actually be able to tell the difference.
Which means, of course, a new build of xunitcontrib to provide support for dotCover. This is a separate release to the ReSharper support – while the products have (pretty close) source code compatibility, there isn’t (yet?) binary compatibility.
Installation instructions are as simple as for the ReSharper plugin:
- Make sure you UNBLOCK the downloaded zip file (right click –> properties –> Unblock).
- MAKE SURE YOU UNBLOCK THE DOWNLOADED ZIP FILE (just checking)
- Extract the zip and copy the xunitcontrib.runner.dotcover folder into C:\Program Files\JetBrains\dotCover\v2.0\bin\plugins (you will probably need to create the plugins folder)
- Restart Visual Studio.
Once installed, xUnit.net tests should be recognised, and you should now be able to run, debug and cover xunit tests.
Note that you DO NOT NEED this plugin if you have ReSharper (and the appropriate xunitcontrib version) installed. By default, dotCover still integrates with ReSharper, if it’s available.
If, however, you want to see what all the fuss is about, you can disable ReSharper’s unit test implementation, and use dotCover’s. Simply go to the ReSharper –> Options –> Unit Testing, uncheck “Enable Unit Testing”, and then go to the dotCover –> Options –> ReSharper Integration and uncheck “Hide all actions and tool windows related to unit tests in dotCover and use ReSharper’s implementation”. You will now be using the dotCover unit test implementation.
It’s going to look very familiar.
(And don’t forget to check out the “Colour Scheme” options if you’ve customised your Visual Studio colours. “Dark” makes SUCH a difference)