Run R# tests without switching to the mouse

As I do test-driven development, I find it annoying to switch over to the Mouse every time I want to run my tests.

So I just hooked up a hotkey for running unit tests.

CTRL+ALT+T usually shows the Test Session pane – I’ve never used it, so I assigned it to:

ReSharper.UnitTest_ContextRun

Context_Run runs the test method your cursor is inside, or if you move out of the method it will run the whole test fixture.

CTRL+SHIFT+F6 (Switch to previous window pane) then brings the focus back to your code.

kick it on DotNetKicks.com

3 thoughts on “Run R# tests without switching to the mouse

  1. There’s also a few standard shortcuts you can use:

    Ctrl + R, A – Run all tests
    Ctrl + R, T – Run tests in context (based on if cursor is in function, class, or namespace)
    Ctrl + R, F – Runs all tests that are checked in Test Results – very handy because that window is impossible to navigate without a mouse

    Ctrl + R, Ctrl + A – Run all tests in debug mode
    Ctrl + R, Ctrl + T – Run all tests in context in debug mode
    Ctrl + R, Ctrl + F – Run all checked tests in debug mode

    • Hi Mikael,

      thanks for the tip! I didn’t really mention, that I use Resharper (R#, if you don’t have it, get it!), while your shortcuts are for MSTest with VS pure.
      But I hooked up your suggestions (slightly different) to the corresponding R#-commands:
      CTRL R, T – Run test/s in context
      CTRL D, T – Debug test/s in context
      CTRL R, S – Run current session
      CTRL R, A – Run all / solution

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s