Rider Help

Unit Tests window

View | Tool Windows | Unit Tests
Alt+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 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 left-hand toolbar:

Toolbar Controls

ControlNameDescription
/help/img/dotnet/2017.2/ThemedIcon.RunTest.Screen.[Gray].png Run Unit Tests Ctrl+U, R Runs selected tests. To select multiple texts, use the Ctrl key.
/help/img/dotnet/2017.2/ThemedIcon.Debug.Screen.[Gray].png Debug Unit Tests Ctrl+U, D Debugs selected tests in the current session.
/help/img/dotnet/2017.2/ThemedIcon.AddedParameter.Screen.[Gray].png Append Tests to Session Ctrl+U, A Click this button to add the selected tests to a test session. Rider will suggest choosing one of the existing sessions or creating a new one.
/help/img/rider/2017.1/icon_ut_group.png Grouping Allows grouping items in the window by different categories.
/help/img/dotnet/2017.2/ThemedIcon.NewSession.Screen.[Gray].png Create New Session Ctrl+U, N Creates a new test session with selected tests, which is then opened in a new unit test session tab.
/help/img/rider/2017.1/ThemedIcon.ExpandAll.Screen.[Gray].png /help/img/rider/2017.1/ThemedIcon.CollapseAll.Screen.[Gray].png Expand All/ Collapse All
Ctrl+NumPad Plus/ Ctrl+NumPad Minus
Expands/collapses all nodes in the current tab.
/help/img/dotnet/2017.2/ThemedIcon.Up.Screen.[Gray].png /help/img/dotnet/2017.2/ThemedIcon.Down.Screen.[Gray].png Previous/ Next
Ctrl+Alt+Up / Ctrl+Alt+Down
Navigate to the previous/next item and scrolls through the source code accordingly.
/help/img/dotnet/2017.2/ThemedIcon.Settings.Screen.[Gray].png Unit Test Settings Opens the Build, Execution, Deployment | Unit Testing page of Rider settings (Ctrl+Alt+S), 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 upper toolbar:

Toolbar Controls

ControlNameDescription
/help/img/dotnet/2017.2/ThemedIcon.Rerun.Screen.[Gray].png Repeat Previous Run Ctrl+U, U Repeats the previous test run.
/help/img/dotnet/2017.2/ThemedIcon.RunAll.Screen.[Gray].png Run Current Session Ctrl+U, Y

Runs all tests in the current session.

/help/img/dotnet/2017.2/ThemedIcon.RunTest.Screen.[Gray].png Run Unit Tests Ctrl+U, R Runs selected tests. To select multiple texts, use the Ctrl key.
/help/img/dotnet/2017.2/ThemedIcon.StopTest.Screen.[Gray].png Stop Execution Stops the current test session.
/help/img/rider/2017.1/icon_rename_session.png Rename Session Use this button to rename the current unit test session.
/help/img/dotnet/2017.2/ThemedIcon.Remove.Screen.[Gray].png Remove Selected Tests Delete Removes selected tests from the current session.
/help/img/dotnet/2017.2/ThemedIcon.StatusAll.Screen.[Gray].png All Tests Show all tests in the current test session.
/help/img/dotnet/2017.2/ThemedIcon.Success.Screen.[Gray].png Passed Tests Only show successful tests and hide all other tests.
/help/img/dotnet/2017.2/ThemedIcon.StatusFailedPassive.Screen.[Gray].png Failed Tests Only show failed tests and hide all other tests.
/help/img/dotnet/2017.2/ThemedIcon.Ignore.Screen.[Gray].png Ignored Tests Only 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.
/help/img/dotnet/2017.2/ThemedIcon.StatusInconclusive.Screen.[Gray].png Inconclusive Tests Only show inconclusive tests. A test is considered inconclusive if it was started but Rider could not read the the test runner output. This could be a sign of an error occurring in the test runner.
/help/img/dotnet/2017.2/ThemedIcon.Time.Screen.[Gray].png Show Time Allows you to show or hide execution time for each item in the test session.
/help/img/rider/2017.1/icon_toggle_output_position.png Toggle Output Use 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.
/help/img/dotnet/2017.2/ThemedIcon.BuildPolicy.Screen.[Gray].png 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, 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, Rider will rebuild all projects in your solution that have changes since the last execution.
    • Never — Rider will not build anything before executing tests. If you choose this option, you will have to make sure that all related projects are built.
  • Platform Type — Lets you explicitly specify platform architecture of the test runner or choose Automatic to use platform architecture corresponding to the project settings.
  • Diagnostics — Click this button to open the log of the last executed test session.

Title bar context menu and buttons

You can right-click on 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:

IconShortcutDescription
/help/img/idea/2017.2/icon_viewMode.png Click this button to access a subset of the context menu commands that let you configure window's viewing mode.
/help/img/idea/2017.2/icon_hideSide.png Shift+Escape Use this command to hide the tool window. You can also use it in combination with the Alt key to hides all tool windows attached to the same tool window bar.
Last modified: 11 October 2017