Are there shortcut keys for ReSharper's Unit Test Runner?

Solution 1:

ReSharper adds items to Visual Studio's keyboard settings dialog box.

Go to:

Tools -> Options, Environment -> Keyboard

In the search bar, type "resharper" and see the vast options that you can control with the keyboard.

Specifically, there is one to launch the unit test explorer window, and there's a couple called

  • ReSharper.ReSharper_UnitTest_RunSolution
  • ReSharper.ReSharper_UnitTest_RunContext

that are likely what you need.

Solution 2:

You could try ... ALT R U R
- if your cursor is in the Test method, then R# just runs that test
- if its in a test class, but not a method, R# runs all the tests in the class

Solution 3:

Resharper > 7 / Visual Studio 2012

You can find them in the defined shortcuts in Visual Studio 2012 under
[Tools] > [Options] > [Environment] > [Keyboard]

I usually use these:

+---------------------------------+----------------+
| Description                     | Shortcut       |
+---------------------------------+----------------+
| Run Test in Debug Mode (Editor) | Ctrl+U, Ctrl+D |
| Run Test (Editor)               | Ctrl+U, Ctrl+R |
| Run Tests from current session  | Ctrl+U, Ctrl+Y |
| Run Tests from solution         | Ctrl+U, Ctrl+L |
+---------------------------------+----------------+
  • Resharper.Resharper_Resharper_UnitTest_DebugContext
  • Resharper.Resharper_Resharper_UnitTest_RunContext
  • Resharper.Resharper_UnitTest_RunCurrentSession
  • Resharper.Resharper_UnitTest_RunSolution

Solution 4:

As for running all tests in solution the command is Alt-RUN, i.e. ALT+R for ReSharper menu, U for Unit Testing, and N for all tests in solution.

And if you're using the R# shortcuts, the chord Ctrl-U, L will always do the job.

NOTE: I found this answer from from stackoverflow user ilya-ryzhenkov on a related question

Solution 5:

For Resharper 4.5 OOTB:

Unit Test Explorer : Ctrl+Alt+U
Unit Test Sessions : Ctrl+Alt+T
Close Active Window : Shift+Esc

I just noticed last week that my keyboard has a right-click button between Alt and Ctrl on the right side, so no mouse needed to mouse to a specific test. Yeah!

Custom key mapping via Ben Scheirman's method:
ReSharper.ReSharper_UnitTest_ContextDebug : Alt+T, Alt+D
ReSharper.ReSharper_UnitTest_ContextProfile : Alt+T, Alt+P
ReSharper.ReSharper_UnitTest_ContextRun : Alt+T, Alt+T and Alt+T, Alt+R
ReSharper.ReSharper_UnitTest_RunSolution : Alt+T, Alt+S
ReSharper.ReSharper_UnitTest_RunSolution : Alt+T, Alt+A