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.
- 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.
- Choose ReSharper | Unit Tests | Unit Tests or ReSharper | Windows | Unit Tests on the main menu. The Unit Test Explorer window opens.
- Select tests 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.
- Depending on which command you have chosen in the previous step, selected tests display or run in the Unit Test Sessions window:
- Select a project node or a solution in Solution Explorer, or open a class in the editor.
- On the ReSharper menu or context menu of the selection, choose Unit Tests | Run Unit Tests or Unit Tests | Debug Unit Tests. The Unit Test Sessions window opens when you start running tests.
NoteWhen 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 markin the gutter.
- On the context menu, select Run... or Debug... to run or debug tests that the test class contains, or Append to Session to include the tests into the current 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.