xunitcontrib-resharper 0.4.4 - dotCover support

by Matt 23. October 2011 12:39

Finally I get around to releasing dotCover support for the xUnit.net ReSharper unit testing plugin. Meant to do this ages ago, and it slipped off the radar – apologies.

The dotCover guys have made integration very nice and easy. Simply right click on a file, or a class, or click the icon next to a test method and select “Cover with dotCover”. The unit tests are run, dotCover thinks for a couple of seconds, and then you get your code coverage.

image

If you have the “Highlight code” icon selected, then all code (tests and production code) is highlighted in green or red depending on your coverage. The options even allows you to select a colour scheme that works with a dark background.

image

And that’s it. There are no other changes in this release.

You can download it from the codeplex site, and installation is the usual unblock, unzip and replace files. But, as a special treat, if you’re playing with my experimental NuGet ReSharper extension manager, you can download the .nupkg file from the same page. If you drop this file into the C:\rsrepo folder (remember, it is experimental), go to ReSharper –> Extension Manager –> Updates, it should appear as an update, ready to install. One small VS restart later, and you’re up and running with the new version.

Tags:

ReSharper plugins via NuGet

by Matt 18. October 2011 10:04

I have this little ReSharper plugin. It is small and rather useful. And one of the most frequent requests I get is for an installer.

I’ve resisted this, mainly because it’s only 4 files. I could see how useful an installer would be, but I wasn’t going to write one just to copy 4 files around. That would be like using a sledgehammer to crack a nut.

Nope. I’m going to use a nuclear bomb to crack a nut.

Instead, I thought it would be more interesting to write an extension manager for ReSharper, based on NuGet. In other words, package ReSharper plugins as NuGet packages, and deliver and manage them in the same way – so you can browse, install, update and uninstall, just like assembly reference NuGet packages.

Something like this:

image

Before we go any further, I need to point out that this is not a finished product – it is very much an experimental ALPHA version. It works, but only just.

It can do the basics just fine – it can browse and install, uninstall and update plugin packages. They’re stored in a nuget repository in your local profile, and get automatically loaded at startup.

The big thing that’s missing is server support. The “Online Gallery” does NOT talk to a server, and is HARDCODED to point at C:\rsrepo.

It’s also missing other useful stuff like error handling, displaying license and progress dialogs and so on.

But it’s functional enough to give a tyre-kicking to, and I’d appreciate the feedback. ReSharper 6.0 only for now.

Here’s what you need to do to get up and running (please read carefully – this is alpha quality!):

  1. Download the zip file from the github downloads page
  2. Extract the contents – you’ll find a .vsix file and 3 .nupkg files
  3. Double click the .vsix file. This will install the plugin (in the future it will be on the Visual Studio Gallery, making this much easier)
  4. Create the C:\rsrepo folder and copy the .nupkg files into it
  5. Fire up Visual Studio
  6. Go to ReSharper –> Extension Manager to bring up the manager UI

If you go to the “Online Gallery” section of the extension manager, you should see the test packages listed. I’ve created a package for the current 6.0 release of xunitcontrib, and two versions of a sample plugin that simply adds a menu item to the ReSharper menu (it just displays a message box with the current version).

Once you’ve installed a package, you need to restart VS before the plugin will get loaded (you’re not yet prompted like NuGet does). Similarly, uninstalling or updating a plugin requires a restart (this is unavoidable – the dlls are loaded into memory and there is no way to unload them. You’ll find the same behaviour in the Visual Studio extension manager).

While you’re in the Online Gallery, you’ll probably notice that it lists all versions of the sample packages, rather than just the latest. Don’t install both versions at the same time – that will confuse things (I told you it was alpha). The two versions are there to test updating – once the oldest version is installed, going to the Updates section will list the newer as ready for updating.

So, what’s next?

Top priority is server support. I need to get a gallery working, and to be able to configure the extension manager with the server feed.

Then, a proper good tidy up – error handling, progress indicators, showing licenses, searching, sorting etc. I’d like to add support for ReSharper 5.1 and the forthcoming 6.1 EAP.

Oh, and more packages would be nice, too.

Creating a package is dead easy – just put your assembly files in an “rs60\plugins” folder. Open one of the sample packages in the NuGet Package Explorer to take a look. Or check out the samples folder in the source on github.

I’d love to hear some feedback. Let me know what you think. Leave a comment here, github or on twitter.

So, that’s how you install 4 files.

Tags:

Rel=Me

Month List

RecentComments

Comment RSS