Udostępnij za pośrednictwem


How to: Organize Tests into Test Lists

Visual Studio Team System Test Edition provides one mechanism for creating groups of tests that persist: test lists. You create and manipulate test lists in the Test List Editor.

The following procedures describe how to work with tests and test lists.

Note

To change the way tests are displayed in the Test List Editor, without creating or changing persistent groupings (lists) of tests, use the Group By feature. For more information, see How to: Customize Test Views.

To organize tests into test lists

  1. Open the Test List Editor.

  2. If the test list you want does not already exist, create it. For more information, see How to: Create a Test List.

  3. To see all your tests listed in the Test List Editor, click the All Loaded Tests node in the test list pane.

  4. Select tests in the Test List Editor. For more information, see How to: Run Selected Tests.

  5. Drag the selected tests from the Test List Editor into the test list.

Note

Only one instance of a test can exist in a test list. You cannot drag a test a second time into the same test list.

To move or copy tests between test lists

  1. Open the Test List Editor.

  2. In the test list pane, click a test list.

    The list's tests appear in the contents pane of the Test List Editor.

  3. Drag a test from the contents pane of the Test List Editor to the destination test list, in the test list pane.

    This removes the test from the source test list and adds it to the destination list.

    Note

    A test can exist in more than one test list. To copy a test to a new list without removing it from the original list, press the CTRL key while dragging the test. Regardless of the number of test lists that contain a test, all instances of the test refer to the same test method.

  4. Alternatively, you can move or copy tests by using the Cut, Copy, and Paste commands. First, right-click a test and then click Cut or Copy. Then, either switch to the destination node or test list and click Paste, or click the name of the node or test list in the test list pane and then click Paste. The test is then moved or copied to the destination node, such as All Loaded Tests, or test list.

To remove tests from a test list

  1. Open the Test List Editor.

  2. Highlight the test list that contains the test or tests you want to remove.

  3. Right-click the test you want to remove, and then click Remove from Test List.

    The test is removed from the list, but it is not deleted from the test project, nor is the list affected in any other way. You can always locate any test in the All Loaded Tests folder, regardless of whether it is present in one or more lists.

    Note

    You cannot remove tests from the All Loaded Tests node or from the Tests Not in a List node.

See Also

Tasks

How to: Customize Test Views

How to: Create a Test List