Export (0) Print
Expand All

Walkthrough: Managing Tests Using Lists and Properties

By using test lists, you can logically group tests and then work with those tests as groups instead of individually. Test lists are especially useful when you have a large number of tests.

Follow the steps in the procedure "Create a Unit Test" in Walkthrough: Creating and Running Unit Tests.

To manage tests using test lists

  1. In Visual Studio, open the Test List Editor. To do this, click Windows on the Test menu and then click Test List Editor.

  2. Click the All Loaded Tests folder in the Test List Editor.

    All the tests in the current project are displayed.

  3. To create a new test list, right-click the Lists of Tests folder and click New Test List.

    The Create New Test List dialog box appears.

  4. In the Name field, type BVTs as the name of the test list, and click OK.

    The BVTs list is created and displayed in the hierarchy pane of the Test List Editor under the Lists of Tests folder.

  5. Click the Tests Not in a List folder in the Test List Editor.

  6. Highlight DebitTest and CreditTest in the data pane of the Test List Editor. To do this, hold down the CTRL key while clicking both tests.

  7. With the tests highlighted, drag them into the BVTs list.

  8. Click the BVTs list in the hierarchy pane.

    This displays its contents, DebitTest and CreditTest, in the contents pane.

  9. Right-click the BVTs list in the hierarchy pane and click Create New Test List.

    The New Test List dialog box appears.

  10. In the Name field, type Bank as the name of the test list and click OK.

    The new test list is created and displayed in the hierarchy pane of the Test List Editor as a list under BVTs.

  11. Click All Loaded Tests in the hierarchy pane.

  12. Copy the DebitTest unit test into the Bank test list. To copy the test, while pressing the CTRL key, drag DebitTest into the Bank test list.

    A new instance of the DebitTest test is created and placed in the Bank test list.

  13. In the hierarchy pane, click All Loaded Tests.

  14. Right-click one instance of DebitTest and click Disable.

    Notice that both instances of DebitTest are disabled.

Community Additions

ADD
Show:
© 2014 Microsoft