CodeRush Unit Test Runner shortcuts and actions
CodeRush Unit Test Runner has a set of predefined shortcuts useful for running and debugging unit test cases inside Visual Studio. All shortcuts are easy to remember: they start from a general Ctrl+T keystroke (where T means Testing) followed by a second key which specifies the operation, for example:
- D – Debug
- F – File run test cases
- P – Project run test cases
- S – Solution run test cases
- and so on…
Here’s the table of Unit Test Runner shortcuts and their corresponding actions. Note that some actions don’t have default shortcuts set.
Shortcut |
Action |
Description |
Ctrl+T, D | UnitTestsDebugAtCursor | Starts the debugging of a test case(s) at the editor caret (cursor) location. The scope is determined from the position of the editor caret; for example, inside a method, a fixture, or a namespace it will start debugging appropriate test cases inside of the mentioned scope. |
Ctrl+T, F | UnitTestsRunFile | Runs test cases located in the current source file. |
Ctrl+T, P | UnitTestsRunProject | Runs test cases located in the current project (selected inside Solution Explorer). |
UnitTestsRunCategory | Runs test cases located in the specified category (passed as a parameter, separated by a semicolon). | |
Ctrl+T, R | UnitTestsRunAtCursor | Runs test cases at the editor caret (cursor) location. The scope is determined from the position of the editor caret; for example, inside a method, a fixture, or a namespace it will start debugging appropriate test cases inside of the mentioned scope. |
Ctrl+T, S | UnitTestsRunSolution | Runs test cases located in the current solution. |
Ctrl+T, T | UnitTestsShowRunner | Shows the main Unit Test Runner tool window. |
RepeatLastTests | Runs test cases that were previously executed or debugged. | |
TestRun | Runs all test cases at the editor caret (cursor) location. The scope is determined from the position of the editor caret, for example, inside a method, a fixture, or a namespace will start debugging appropriate test cases inside of the mentioned scope. | |
TestDebug | Starts the debugging of a test case(s) at the editor caret (cursor) location. The scope is determined from the position of the editor caret; for example, inside a method, a fixture, or a namespace it will start debugging appropriate test cases inside of the mentioned scope. | |
RunFolderTests | Runs test cases located in the current folder inside Solution Explorer. | |
UnitTestsRunCurrentClass | Runs test cases located in the current source type declaration. | |
UnitTestsDebugCurrentClass | Starts debugging test cases located in the current source type declaration. | |
UnitTestsDebugCategory | Starts debugging test cases located in the specified category (passed as a parameter, separated by a semicolon). | |
UnitTestsRunFailed | Runs test cases that were failing in the previous run. | |
UnitTestsDebugFailed | Starts debugging test cases that were failing in the previous run. | |
UnitTestsDebugSolution | Starts debugging test cases located in the current solution. |
There is also a second set of shortcuts called “Visual Studio Style” that is disabled by default. These shortcuts start with the general Ctrl+R keystroke:
Shortcut |
Action |
Description |
Ctrl+R, A | UnitTestsRunSolution | Runs test cases located in the current solution. |
Ctrl+R, C | UnitTestsRunCurrentClass | Runs test cases located in the current source type declaration. |
Ctrl+R, Ctrl+A | UnitTestsDebugSolution | Starts debugging test cases located in the current solution. |
Ctrl+R, Ctrl+C | UnitTestsDebugCurrentClass | Starts debugging test cases located in the current source type declaration. |
Ctrl+R, Ctrl+F | UnitTestsDebugFailed | Starts debugging test cases that were failing in the previous run. |
Ctrl+R, Ctrl+T | UnitTestsDebugAtCursor | Starts debugging of a test case(s) at the editor caret (cursor) location. The scope is determined from the position of the editor caret, for example, inside a method, a fixture, or a namespace will start debugging appropriate test cases inside of the mentioned scope. |
Ctrl+R, F | UnitTestsRunFailed | Runs test cases that were failing in the previous run. |
Ctrl+R, T | UnitTestsRunAtCursor | Runs test cases at the editor caret (cursor) location. The scope is determined from the position of the editor caret, for example, inside a method, a fixture, or a namespace will start debugging appropriate test cases inside of the mentioned scope. |
To enable these shortcuts, open the Shortcuts options page in the CodeRush Options Dialog and click the Enabled check box on the “Visual Studio Style” folder inside the UnitTesting parent folder (click on the image to enlarge):
If you would like to assign a shortcut key for those actions that are missing them, please read the “How to assign a shortcut key to a particular action” topic.
—– Products: CodeRush Pro Versions: 12.1 and up VS IDEs: any Updated: Oct/29/2012 ID: C104