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.

Testing_NewSessionEditor

 

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.

Testing_SesstionFromWindow

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.

Testing_SessionRename

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.

Note

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