JetBrains Rider 2021.1 Help

Unit Tests window

View | Tool Windows | Unit Tests
Alt+Shift+8

This window lets you manage all your unit testing activities in different tabs.

To search tests, start typing a test name or its CamelHumps abbreviation as soon as your focus is in this window.

Explorer tab

Using this tab, you can explore and run, debug, or cover unit tests of all supported frameworks in the entire solution. Note that unit tests from a project only appear in the tab after the project is built. Tests from currently opened files are updated automatically, new tests from the opened files appear in the unit test explorer as soon as you create them.

Unit Test Explorer displays tests from the entire solution

When the Explorer tab, or any unit test session tab is open, you can use the following controls on the toolbars:

Left Toolbar

ControlNameDescription
Icons run configurations test state run run Run All Tests Ctrl+Shift+Enter

Runs all tests in the tree.

You can use the integrated drop-down selector for other actions

Themed icon cover all screen grayCover Current SessionRuns coverage analysis for all unit tests in the test session.
Themed icon utr profile all screen grayProfile Current SessionStarts performance profiling for all tests in the current session.
Rider resharper dot memory unit private dot memory unit run all Run All Tests under dotMemory UnitRuns all tests in the current tree with dotMemory Unit enabled. Use this button to run tests that use dotMemory Unit framework to check code for memory issues.
Icons run configurations test state run Run Selected Tests Shift+Enter

Runs selected tests. To select multiple tests, click them holding the Ctrl key.

You can use the integrated drop-down selector for other actions on the selected tests:

Themed icon cover screen gray Cover Selected TestsBy clicking this button, you can start code coverage of the selected tests.
Themed icon utr profile screen grayProfile Unit TestsBy clicking this button, you can profile selected tests.
Themed icon dot memory unit run screen grayRun Unit Tests under dotMemory Unit Ctrl+;, MRuns selected tests with dotMemory Unit enabled. Use this button to run tests that use dotMemory Unit framework to check code for memory issues.
Run Selected Tests Until FailureClick this button to keep automatically starting and running selected tests until one of the tests fails.
Icons actions start debugger Debug Selected Tests Ctrl+;, DStarts debugging for selected tests in the current session.

Top Toolbar

ControlNameDescription
Icons toolbar decorator importImport SessionClick to open a test session that you have previously saved in a .testsession file.
Themed icon expand all screen gray Themed icon collapse all screen grayExpand All/ Collapse All
Ctrl+NumPad +/ Ctrl+NumPad -
Expands/collapses all nodes in the current tab.
Icons actions group byGroup byAllows grouping items in the window by different categories.
Themed icon up screen gray Themed icon down screen grayPrevious/ Next
Ctrl+Alt+Up/ Ctrl+Alt+Down
Navigate to the previous/next item and scrolls through the source code accordingly.
Themed icon settings screen grayUnit Test SettingsOpens the Build, Execution, Deployment | Unit Testing page of JetBrains Rider settings, where you can configure all settings related to unit testing.

Unit test sessions tabs

These tabs appear each time you run tests from the current document or from the project or solution. For every new combination of tests (unit test session), a new tab opens.

These tabs are designed to help you run any number of unit test sessions, simultaneously and independently of each other. Sessions can be composed of any combination of tests. In the debugging mode, only one session can be run at a time.

The unit test tree shows the structure of tests belonging to a session, which you can filter to show only passed, failed or ignored unit tests. You can navigate to the code of any unit test by double-clicking it.

A unit test session displayed in the Unit Tests window

When a unit test session tab is open, you can additionally use the following controls on the toolbars:

Left Toolbar

ControlNameDescription
Themed icon rerun screen grayRepeat Previous Run Ctrl+;, TRepeats the previous test run.
Icon rerun failed testsRerun Failed Tests Ctrl+;, FStarts execution of tests that failed in the previous run.
Themed icon stop test screen grayStop ExecutionStops the current test session.

Top Toolbar

ControlNameDescription
Themed icon status all screen grayAll TestsShow all tests in the current test session.
Themed icon success screen grayPassed TestsOnly show successful tests and hide all other tests.
Themed icon status failed passive screen grayFailed TestsOnly show failed tests and hide all other tests.
Themed icon ignore screen grayIgnored TestsOnly show ignored tests and hide all other tests. A test is ignored if it has the corresponding attribute, or if the whole category where it belongs is ignored.
Icon broken testsBroken TestsOnly show broken tests. A test is considered broken if it 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.
Icon toggle output positionToggle Output PositionUse this button to change the position (right or bottom) of the output pane, which lets you analyze test results and navigate from a failed test's output to the code lines that originated the assertion or exception.
Icons general gear plain Session Options

You can configure this set of preferences individually for each test session.

  • Build Policy — Specifies whether building is required before executing tests. Provides several options:
    • Automatic (selected by default) — Before executing tests, JetBrains Rider will rebuild all projects that are related to the current test session and that have changes since the last execution.

    • Whole Solution — Before executing tests, JetBrains Rider will rebuild all projects in your solution that have changes since the last execution.

    • Never — JetBrains Rider will not build anything before executing tests. If you choose this option, you will have to make sure all related projects are built.

  • Themed icon lock session screen gray Lock SessionLocks the current test session to prevent automatically adding new tests to this session.

  • Show Time — Allows you to show or hide execution time for each item in the test session.

  • Platform — Lets you explicitly specify platform architecture (x86 or x64) of the test runner or choose Automatic to use platform architecture corresponding to the project settings.

  • Target Framework — Lets you explicitly specify the .NET framework (CLR) version of the test runner or choose Automatic to use the latest installed version.

  • Diagnostics — Click this button to open the log of the last executed test session.

Title bar context menu and buttons

You can right-click the window title bar and use the context menu to configure its viewing mode, associate the window with a different tool window bar, or resize and hide the window.

You can also use the toolbar buttons:

ItemShortcutDescription
Scroll from Editor

Automatically sets the focus on the object name in the Project view when the editor area is in focus.

Hide tool windowShift+Escape

Hide the tool window.

To hide all the tool windows, press Ctrl+Shift+F12.

Last modified: 08 March 2021