ReSharper Help

Unit Test Sessions

ReSharper | Windows | Unit Test Sessions
ReSharper | Unit Tests | Unit Test Sessions

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 Using Unit Test Sessions.


The window is designed to help you run any number of unit test sessions, independently of each other, as well as simultaneously. 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.

The progress bar and the status bar display the current progress. You can stop, run or re-build and re-run unit tests at any time.

Using the Show Output toolbar_show_preview selector, you can open the Output and the Coverage panes and place them to the bottom or to the right of the window.

Output pane

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

Coverage pane

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

Window tabs

When you open new unit test sessions 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 with 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 choosing the desired tab:

Tool window tabs

Toolbar controls

uts_toolbar_rerun Repeat Previous Run Repeats the previous test run.
uts_toolbar_run_all_tests Run All Tests

Runs all tests in the current session.

icon_cover_all Cover All Tests By clicking this button, you can run coverage analysis for all unit tests in the test session.

This button appears if dotCover is integrated with ReSharper.

icon_profile_all Profile All Tests with dotTrace By clicking this button, you can profile all tests. This button appears if dotTrace is integrated with ReSharper.
toolbar__run_selected_tests Run Unit Tests Runs selected tests. To select multiple texts, use the Ctrl key.
uts_toolbar_debug_selected_tests Debug Unit Tests Debugs selected tests in the current session.
uts_toolbar_cover Cover Unit Tests By clicking this button, you can perform code coverage on the selected tests.

This button appears if JetBrains dotCover is integrated with ReSharper.

uts_toolbar_profile Profile Selected Tests This button appears if dotTrace is integrated with ReSharper. By clicking this button, you can profile selected tests.
uts_toolbar_stop_execution Stop Execution Stops the current test session.
uts_toolbar_show_all_tests Show All Tests Shows successful, failed, and ignored tests in the tree view.
uts_toolbar_show_only_failed_tests Show Only Failed Tests Hides anything but failed tests from the tree view.
uts_toolbar_show_only_ignored_tests Show Only Ignored Tests Hides anything but ignored tests from the tree view.
toolbar__filter_usages Filter Tests Allows choosing any combination of test results (successful, failed, or ignored) to display.
uts_toolbar_build_settings Build Settings Specifies whether building is required before running tests. Provides three options:
  • Automatic (selected by default).
  • Always Build
  • Never Build
uts_toolbar_track_running_test Track Running Test Specifies whether ReSharper should select test entries when the corresponding tests are executed.
icon_auto_scroll_output Auto Scroll Output When Running Test This button enables the output pane to scroll when the test is running so that the end of the output is always visible.
toolbar__remove Remove Selected Tests Removes selected tests from the current session.
uts_toolbar_lock_session Lock Session Locks the current test session to prevent extending it with new tests.
toolbar__time Show Time Specifies whether to show the duration time of the last execution for items in the tree.
A test run duration is calculated as the execution time of the test method itself (marked with [TestMethod] attribute in case of MSTest, or with [Test] attribute in case of NUnit, etc.) plus all related methods (e.g. for MSTest - [TestInitialize], [TestCleanup], etc.).
toolbar__expand_all toolbar__collapse_all Expand All/ Collapse All Expands/collapses all nodes in the current tab.
toolbar__previous toolbar__next Previous/ Next Navigate to the previous/next item and scrolls through the source code accordingly.
toolbar_show_preview Show Output Specifies whether the preview pane should be displayed, and offers two alternative positions: below or to the right of the tree view.
toolbar__export Export Click this button to export the data currently displayed in the window in text format, or use the drop-down selector to export the data in XML or HTML format. The Export Data dialog box that appears, will help you to save the data to a file or copy it to the clipboard.

Group by Allows grouping items in the window. Possible options help display items as a tree grouped by the selected categories.
tab_close Close Closes the current tab.

See Also

Last modified: 21 September 2015