Unit Testing
JetBrains Rider helps discover and run, debug or cover unit tests. The following unit testing frameworks are supported:
NUnit 2.6.2 ... 3.10.1. JetBrains Rider installation includes 2 bundled versions of NUnit test runners (2.6.4 and 3.6.1). You can choose one or both of them, or specify a local installation of NUnit on the page of JetBrains Rider settings (Ctrl+Alt+S).
MSTest V1 (Windows only, requires Visual Studio installed), V2 (.NET Core, xplat)
Analyzing code coverage of unit tests is one of the major usage scenarios for JetBrains Rider. It allows developers and test engineers to quickly locate parts of code not covered with unit tests and adjust their testing activities accordingly.
Before running coverage analysis, make sure that the PDB information exists for all target assemblies. The safest choice would be to set the Debug as the build configuration.
With JetBrains Rider, you can execute a single unit test, all tests in a test class, file, project or solution. You can also execute any number of tests combined in a test session.
In this section:
- In Current Document
- In Project or Solution
- Using Unit Test Sessions
- Executing Tests and Analyzing Results
- Monitoring Memory with dotMemory Unit
All JetBrains Rider unit testing actions are available from the
menu or from the Unit Testing Quick List (Shift+Alt+U):You can use the following shortcuts for for unit testing commands:
Command | Shortcut |
---|---|
Shift+Alt+U | |
Ctrl+U, R | |
Ctrl+U, D | |
Ctrl+U, S | |
Ctrl+U, U | |
Ctrl+U, F | |
Ctrl+U, W | |
Ctrl+U, L | |
Ctrl+U, N | |
Ctrl+U, A | |
Ctrl+U, Y | |
Ctrl+U, M | |
Alt+8 | |
Shift+Enter | |
Ctrl+D | |
Ctrl+Y | |
Ctrl+F | |
Shift+Alt+Insert | |
Ctrl+Alt+Insert | |
Delete | |
Ctrl+L |
For the full list of Rider keyboard shortcuts, see Keyboard Shortcuts Reference.