When authoring tests using Visual Studio 2019 you may find yourself running tests continually. Whether you’re running tests on a fresh clone to make sure tooling is working or running them while making changes to code, you may find yourself running tests frequently.

You may find the experience of clicking around the UI taxing. Keyboard shortcuts can improve the experience, especially after you’ve committed them to memory and they just happen.

Note: Some of the following are chords. For example, after pressing Ctrl+r you’ll see “(Ctrl+R) was pressed. Waiting for second key of chord…” on the status bar at the bottom (unless you hid the status bar, of course).

  • Ctrl+e t: Open Test Explorer
  • Ctrl+r a: Run all tests
  • Ctrl+r t: Run test or tests in context of cursor
  • Ctrl+r Ctrl+t: Debug test or tests in context of cursor

Other Helpful Keyboard Shortcuts

While not specifically testing related, here’s some others you may find helpful:

  • Ctrl+Shift+b: Build Solution
  • F5: Start Debugging
  • Shift+F5: Stop Debugging
  • Ctrl+F5: Start Without Debugging
  • Ctrl+Alt+l: Open Solution Explorer