ReSharper Web Help

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.

To run tests from the Unit Test Explorer
  1. 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.
  2. Choose ReSharper | Unit Tests | Unit Tests or ReSharper | Windows | Unit Tests on the main menu. The Unit Test Explorer window opens.
  3. Select tests that you want to run:
    Unit Test Explorer tool window
  4. Click one of the following buttons in the Unit Test Explorer toolbar:
    • Run Selected Tests Run Selected Tests to run selected tests in the currently active session of the Unit Test Sessions window.
    • Append Selected Tests to Session 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 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.
  5. Depending on which command you have chosen in the previous step, selected tests display or run in the Unit Test Sessions window:
    Unit Test Sessions tool window
To run or debug tests from the text editor or Solution Explorer
  1. Select a project node or a solution in Solution Explorer, or open a class in the editor.
  2. 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.

 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.
To run or debug an individual test using side bar marks
  1. In the editor, open a class that contains unit tests.
  2. Click a side bar mark in the gutter.
  3. 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:
  4. 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.

See Also

Procedures

Reference