The requested page is not available for the requested platform. You are viewing the content for Default platform.

Working with Test Sessions

The Unit Test Runner supports sessions. This enables you to create several test sets and run them independently. There are two ways to create a session.

Creating a New Session

From the Code Editor

Click the icon that supplements the Test or TestFixture attribute and select the Add to session | Create a new session menu item.


From the Test Runner Window

Right-click a node in the Test Runner window and select the Add to session | Create a new session menu item.


After the session is created, you can name it by renaming the newly added Test Runner window tab. Double click the tab text to edit it.


The tests included in the session are defined by one or more filters (e.g., namespace, type, assembly, etc.). You can extend any session with a set of tests: follow the procedure of creating a new session, but choose the required session (instead of creating a new one) at the final step. Session tests update automatically as you create new tests that match the session's filter.


Sessions are saved to the solution's .suo file and will persist after the Visual Studio restart.