Execute tests and analyze results
tip
JetBrains Rider's unit test runner does not allow running two or more tests with the same ID. This rarely happens in practice, but if you do have tests with the same ID, they will appear as a single node in the Unit Tests window, and only one of them will run.
Note that test frameworks identify tests in different ways. For example, MSTest uses test-methods FQNs but NUnit uses properties of test attributes as test IDs.
JetBrains Rider provides several ways to execute unit tests. Whichever way you choose, execution progress, test results, and output are displayed in the Unit Tests window , coverage results are shown in the Unit Test Coverage window .
Before running coverage analysis or performance profiling, make sure that the PDB information exists for all target assemblies. The safest choice would be to build your code with the Debug build configuration.
Use one of the ways to execute tests in the current document.
Use one of the ways to execute tests in the project/solution.
If there are existing unit test sessions, you can run, debug, or cover some or all tests in a session:
Select tests that you want to execute in the session tab of the Unit Tests window and click Run Unit Tests
Ctrl0U,0R/ Debug Unit Tests
Ctrl0U,0D on the toolbar.
To run all tests in the session, click Run Current Session
Ctrl0U,0Y on the toolbar or alternatively, choose Tests | Run Current Session from the main menu.
To keep automatically starting and running selected tests until one of the tests fails, choose Run Selected Tests Until Failure from the session's context menu, or Tests | Run Selected Tests Until Failure from the main menu.
As tests are running in a unit test session, the progress icon is displayed next to the currently executing test. You can run multiple unit test sessions simultaneously. However, when you debug tests, only one test session can be executed at a time.
Click Stop Execution
on the toolbar to abort execution of the tests.
JetBrains Rider will send the signal to the test runner to stop execution. Depending on the test framework, the execution can be aborted immediately, or the runner may try to finish the current test and stop after that.
If the test runner continues executing the current test, the Stop Execution icon changes to
. You can click it again to force quit the test runner process.
If necessary, you can always repeat execution or coverage analysis of the tests that you executed last by clicking Repeat Previous Run on the toolbar, pressing Ctrl0U,0U or choosing Tests | Repeat Previous Run from the menu.
You can also re-run tests that failed by pressing Ctrl0U,0F or choosing Tests | Rerun Failed Tests from the menu.
JetBrains Rider automatically creates a new run configuration for each test session. The created run configuration stays synchronized with the corresponding session until you close the session in the Unit Tests window.
When the execution is over, the results are visualized in the Unit Tests window.

The output pane (which you can place on the right or at the bottom using the Toggle output position button on the toolbar) displays output of the selected test. If the test is failed, JetBrains Rider also adds short information on the failure and/or displays the stack trace of an exception. You can use clickable links in the output pane to navigate directly to types and methods involved with the failure.
By default, JetBrains Rider wraps long lines in the output according to the current width of the output area. If necessary, you choose not to wrap long lines by clearing the Wrap long lines in Unit Test Session output checkbox on the Build, Execution, Deployment | Unit Testing page of JetBrains Rider settings CtrlAlt0S.
Use the Group by selector on the toolbar to change grouping of the tests — you can either choose one of the predefined grouping modes in the upper part of the selector, such as Test Hierarchy, Project Structure, and so on, or use the lower part of the selector to choose a custom set of grouping properties.
On the status bar, you can see the total number of tests in the session as well as number of tests in different states:
By default, tests in all states are shown, but you can click the corresponding icons to filter tests by their state.
Status of each test in the Unit Test Sessions window is displayed with one of the following icons:
Unit test is currently executing | |
Unit test is scheduled for execution in the current run | |
| Unit test was not executed |
Unit test passed in the lats test run | |
Unit test failed in the lats test run | |
Unit test was ignored in the last test run | |
| Unit test was started but JetBrains Rider could not read the test runner output. This normally happens when you abort test execution, but could also be a sign of an error occurring in the test runner. |
The same icons are used to display status of grouping items (classes, projects, and so on)
The icons are also used on each session's tab to display the overall execution result of the sessions.
The corresponding icons above the test session tree show how many tests are in each of the states. The icon shows the total number of tests in the session.
Using these icons, you can filter the tree so that only tests in the corresponding status are displayed.
When your focus is in the Unit Tests window, you can use simplified shortcuts for unit testing actions. For example, you can use Ctrl0D instead of Ctrl0U,0D for debugging selected tests. Here is the full list of extra shortcuts that work in the Unit Tests window:
ShiftEnter — Run Selected Tests
Ctrl0D — Debug Selected Tests
Ctrl0Y — Run Current Session
AltShiftInsert — Create New Session
CtrlAltInsert — Append Selected Tests to Session
Delete — Remove Selected Tests
Ctrl0L — Run All Tests from Solution
By default, JetBrains Rider uses unit test project settings to define which .NET Framework version and processor architecture should be used when executing tests.
note
If execution settings are different in different unit test sessions, it is possible that a test passes in one session and fails in another. Therefore, JetBrains Rider does not update execution results in other sessions, where the same tests are added. Also, the execution status icon displayed for a test in the editor corresponds to the result from the test session where it was last executed.
When tests in your project use (sometimes indirectly or implicitly) an assembly based on CLR2 and your project already targets CLR4, errors may occur during test execution. You can avoid such situation, by specifying explicitly what CLR (.NET Framework) should be used. To do so, use the Default .NET Framework version selector on the Build, Execution, Deployment | Unit Testing page of JetBrains Rider settings CtrlAlt0S. This preference affects tests running under NUnit, XUnit and MSpec test frameworks. It has no effect on tests running under MSTest yet.
You can also change the platform architecture (32-bit or 64-bit) using the Default platform architecture selector on that options page.
If necessary, you can override these settings for specific unit test session using the Session Options selector on the toolbar.
Unit Tests window includes test execution log that lets you separate problems related to test execution process from unit tests results.
You will normally need to check execution log if some of your tests have the 'Inconclusive' state after execution, which could be a sign of an error occurring in the test runner.
To open the execution log, click Session Options on the toolbar and choose Diagnostics | Show Last Launch Log or Diagnostics | Show Last Runner Log.