Wednesday, August 11, 2010

ReSharper shortcuts for VS2010 to improve TDD productivity

ReSharper is a powerful tool that helps you to produce better code.
One very nice feature is to run your NUnit-Test within the integrated Testrunner. But it’s a little bit annoying to click on the play button every time you want to run a test.
The easiest thing to handle this is to set up keyboard shortcuts to run you tests. Visual Studio supports setting shortcuts for a lot of actions, so let’s go straight ahead and set up shortcuts.
Simple open the options dialog for keyboard settings via Tools –> Customize –> hit “Keyboard” button and then search for
ReSharper.ReSharper_UnitTest_

As result you get something like the following:
image

Now you can set the shortcut for the desired operation.

I have chosen combinations of

Ctrl + Shift + Alt & '<'

A short explanation of the shown possibilities:
  • ContextRun runs the current selected test
  • ContextDebug debugs the current selected test
  • RunCurrentSession reruns a previous test session
  • RunSolution runs all test within the solution
Have fun.