ReSharper 2021.1 Help

Unit Test Sessions window

ReSharper | Windows | Unit Test Sessions
ReSharper | Unit Tests | Unit Test Sessions
Control+Alt+R

ReSharper runs unit tests in the Unit Test Sessions window. The window appears automatically when you run tests from the current document or from the project or solution. For more information, see Unit Test Sessions.

ReSharper: Unit Test Sessions window

The window is 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.

Status bar and progress bar

The progress bar and the status bar under the toolbar display the current progress.

On the status bar, you can see the total number of tests in the session as well as number of tests in different states:

Unit test filters

By default, tests in all states are shown, but you can click the corresponding icons to filter tests by their state. You can also Ctrl -click several icons to display tests in several different states.

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.
Themed icon status unknown screen grayUnknown TestsOnly show tests that either were not executed or have changed since the last execution.
Themed icon session log screen grayExecution logLets you see either the number of test execution errors (related to the execution process, not tests themselves) or shows OK if there are no errors.
You can click this icon to show or hide the execution log.

Window tabs

When unit test sessions open in the window, they are displayed in new tabs, which show up on the left. The previously open tabs move to the right if the width of the window allows, otherwise they unload themselves saving memory - but you can always restore them by clicking the arrow that appears to the right of the tabs and clicking the required tab:

Tool window tabs

To prevent a tab from unloading, click the pin icon Themed icon pin screen gray next to the tab title.

Toolbar Controls

ControlNameDescription
Themed icon rerun screen grayRepeat Previous Run Control+T TRepeats the previous test run.
Themed icon run all screen grayRun Current Session Control+T Y

Runs all tests in the tree.

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

Themed icon cover all screen grayCover Current Session Control+T IRuns coverage analysis for all unit tests in the test session.

This button appears if JetBrains dotCover is integrated with Visual Studio.

Themed icon utr profile all screen grayProfile Current SessionStarts performance profiling for all tests in the current session.

This button appears if JetBrains dotTrace is integrated with Visual Studio.

Themed icon dot memory unit run screen grayRun Current Session 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.
Themed icon run test screen grayRun Unit Tests Control+T R

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 grayCover Unit Tests Control+T HBy clicking this button, you can start code coverage of the selected tests.

This button appears if JetBrains dotCover is integrated with Visual Studio.

Themed icon utr profile screen grayProfile Unit TestsBy clicking this button, you can profile selected tests.

This button appears if JetBrains dotTrace is integrated with Visual Studio.

Themed icon dot memory unit run screen grayRun Unit Tests under dotMemory Unit Control+T MRuns selected tests with dotMemory Unit enabled. Use this button to run tests that use dotMemory Unit framework to check code for memory issues.
Themed icon run test screen grayRun Unit Tests Until FailClick this button to keep automatically starting and running selected tests until one of the tests fails.
Themed icon debug screen grayDebug Unit Tests Control+T DStarts debugging for selected tests in the current session.
Themed icon stop test screen grayStop ExecutionStops the current test session.
Autostart tests run allAutostart Tests on Build|Save: Run All TestsEnables continuous testing for the current unit test session. All tests in the session will be automatically run on explicit user action: build or save (selected in continuous testing settings).
Autostart tests run outdatedAutostart Tests on Build|Save: Run New and Outdated TestsEnables continuous testing for the current unit test session. Only new and outdated tests in the session will be automatically run on explicit user action: build or save (selected in continuous testing settings).
Autostart tests cover outdatedAutostart Tests on Build|Save: Cover New and Outdated TestsEnables continuous testing for the current unit test session. New and outdated tests in the session will be automatically run with enabled coverage analysis on explicit user action: build or save (selected in continuous testing settings).
Themed icon track run screen grayTrack Running TestIf this button is on, the selection in the list of tests is switched automatically to the test that is currently executing.
Themed icon scroll to bottom screen grayAuto Scroll Output When Running TestThis button enables the output pane to scroll when the test is running so that the end of the output is always visible.
Themed icon remove screen grayRemove Selected Tests DeleteRemoves selected tests from the current session.
Themed icon export screen grayExport SessionClick to save the current test session in a .testsession file.
Themed icon import screen grayImport 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 AllExpands/collapses all nodes in the current tab.
Themed icon up screen gray Themed icon down screen grayPrevious/ Next
Shift+F8/ F8
Navigate to the previous/next item and scrolls through the source code accordingly.
Themed icon preview toggle screen grayShow Output Ctrl+P

This selector allows you to open the Output and the Coverage panes and place them to the bottom or to the right of the window.

The Output pane lets you analyze test results and navigate from a failed test's output to the code lines that originated the assertion or exception, all with a single click.

The Coverage pane displays the code coverage tree and appears if JetBrains dotCover is integrated with ReSharper.

Options

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

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

    • Automatic (whole solution) — Before executing tests, ReSharper will rebuild all projects in your solution that have changes since the last execution.

    • Never Build — ReSharper 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.

  • Themed icon time screen gray 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.

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

  • Group by — Allows grouping items in the window by different categories.

Themed icon stack trace explorer tool window screen grayShow Stack Trace in a new Window Ctrl+Shift+Alt+EOpens the output of the currently selected test in a new tab of the Stack Trace Explorer window.
Themed icon update screen grayReference dotMemory Unit FrameworkInstalls the dotMemory Unit Testing Framework NuGet package and references it in the unit test project where the selected test belongs.

This button appears if JetBrains dotMemory is integrated with Visual Studio.

Last modified: 08 March 2021