How to: Run Database Unit Tests

You can run a database unit test in any one of several ways, such as using various windows and the Command Prompt window.


You cannot run database unit tests remotely, that is, by using a test rig.

The ways that are available to you depend on the software that you have installed, as described in Ways to Run Database Unit Tests. If you have installed Visual Studio Team System Database Edition, you will typically use the Test View window to run database unit tests.

To run database unit tests using the Test View window

  1. On the Test menu, point to Windows, and then click Test View.

    The Test View window opens.

  2. In the Test View window, click the test or tests that you want to run. By using the CTRL key or the SHIFT key, you can specify discontinuous or continuous blocks of tests.

  3. Do either of the following:

    • Right-click the surface of the Test View window, and then click Run Selection.

    • On the Test View toolbar, click Run Selection.

To run database unit tests from the Database Unit Test Designer

  • On the Test Tools toolbar, click either of the test run icons:

    • StartSelected Test Project with Debugger (For some profiles, as an alternative, you can press SHIFT+ALT+X.)

    • Start Selected Test Project without Debugger (For some profiles, as an alternative, you can press CTRL+ALT+X.)

This step runs all tests in the current test run. As soon as you start a test run, the Test Results window appears and displays the progress of the test run. This display includes tests that are running and tests that have completed. For more information, see Interpreting Database Unit Test Results.

See Also


How to: Run Selected Tests


Terminology Overview of Database Edition

Other Resources

Configuring Test Execution

Obtaining Test Results

Command-Line Test Execution