ReSharper provides Unit Test Explorer for viewing tests and arranging test sessions, and the Unit Test Sessions window for running test sessions and viewing test results. So, with ReSharper you can:
- run and debug tests
- add tests to a session
- lock a session
- work with a group of tests
- ignore a group of tests
Run and debug tests
- Make sure that your project has been built. Otherwise, ReSharper will not be able to populate Unit Test Explorer with the list of test fixtures that it contains.
-
Open the Unit Test Explorer window. To do that, do one of the following:
- On the main menu, choose ReSharper | Unit Tests | Unit Tests.
- On the main menu, choose ReSharper | Windows | Unit Tests.
- Press Ctrl+Alt+T.
-
Select test(s) that you want to run:

-
Click one of the following buttons in the Unit
Test Explorer toolbar:
-
Run Selected Tests
to run
selected tests in the currently active session
of the Unit Test Sessions
window.
-
Append Selected Tests to Session
to include selected tests into the session tab that is
currently active in the
Unit Test Sessions
window, without running them right away.
-
New Session with Selected Tests
to create a new session in the
Unit Test Sessions
window containing the selected tests, without
running them right away.
-
Run Selected Tests
-
Depending on which command you have chosen in the previous step, selected
tests display or run in the Unit Test Sessions window:

- Open a class in the editor or select a test in File Structure, or select a node (project or solution node) in the Solution Explorer.
-
Do one of the following:
- On the main menu, choose ReSharper | Unit Tests | Run Unit Tests.
- Right-click, then click Run Unit Tests on the context menu.
- Press Ctrl+T,R.
- Open a class in the editor or select a test in File Structure, or select a node (project or solution node) in Solution Explorer.
-
Do one of the following:
- On the main menu, choose ReSharper | Unit Tests | Debug Unit Tests.
- Right-click, then click Debug Unit Tests on the context menu.
- Press Ctrl+T,D.
Note
When tests are run or debugged from the
editor, the caret position defines which test or tests are be
involved. If the caret is inside a test method, that single test
is run or debugged. If it is outside any test method, the
entire test class contained in the current file is run or
debugged.
- In the editor, open a class that contains unit tests.
- Click a side bar mark in the gutter.
-
On the context menu, click Run or Debug
to run or debug tests that the test class contains, or click Append to Session
to include the tests into the specified (or a new) session in the
Unit Test Sessions window
(note that you can't add tests to a locked unit test session).

Individual test marks let you run and debug a single test independently of other tests in the same class:
- A selected test or all tests in a class are run as a single session in the Unit Test Sessions window where you're able to review the test results.
Add tests to a session
-
In the editor, click a side bar mark.
On the context menu, click Append to Session, depending on your goal
click Create New Session or click [session name].

- In the Unit Test Explorer window, right-click a test to run, then click Create New Session or click [session name] on the context menu.
Quick unit test search
Starting with ReSharper 7.1 you can quickly filter unit tests in the Unit Test Session window.
To do that, start typing text to be matched when the the Unit Test Session window is focused.

Lock a session
You can easily lock the active session, so all new tests will be run in a new session
and can't be included in the locked one. To do that, click Lock Session
on the toolbar of the Unit Test Sessions window.
Work with a group of tests
If you create automated tests, you probably use categories to simplify test management.
You add test categories as attributes to your test methods or test classes.

The AspBlockCommentTest class has the Category attribute,
and all test methods within the class belong to this category. So you can work with a particular test
or a group of tests from the same category.

- In the editor, open a class that contains unit tests.
- Click a side bar mark in the gutter.
- On the context menu, click Category "[category name]", then click Run or Debug depending on the goal.
Ignore a group of tests
- On the main menu, choose ReSharper | Options. The Options dialog box opens.
- Click the Unit Testing node in the left tab.
- In the Unit Testing tab, type names of categories that should be ignored in the Don't run tests from categories box.
- Click Save or Save To to apply changes.
ReSharper supports TestCase, TestCaseSource, Values and other attributes.
