To run all tests against a database
1. In Object Explorer, right-click a connected database or a specific database object, click Unit Test, and then click Run All Tests.
2. After the tests are completed, the Test Results window appears. The window displays a grid containing details for each test. Specifically, it shows the status of a test (failed or succeeded), test name, class name, and error message (if any).
There are several buttons on the Test Results toolbar for managing the results of tests, in particular:
Run Checked Tests (Ctrl+R) reruns all the checked tests.
Run All Tests reruns all the tests.
Stop Tests stops running the tests.
You can also right-click the test results grid to call a shortcut menu.
The Run Selected Test(s) option allows rerunning the selected test(s).
The Open Test option allows opening the required test in a new SQL document.
The Run Checked Tests (Ctrl+R) option allows rerunning the checked test(s).
Note
When you select the Run Checked Test(s) option, Unit Test runs all tests labeled with check marks. By default, all tests are labeled with check marks. In order not to clear the checkboxes if you need to run only one or a couple of tests, you can click to select the required test, then right-click it and click Run Selected Test(s). To select several tests, hold Ctrl. When you select Run Selected Test(s), Unit Test does not run the tests labeled with check marks, but only the tests that are selected. They are highlighted in yellow.
You can also run tests from the Test List Manager. It allows running all tests, selected tests, and checked tests.
To run all tests
You can select the Run All Tests option in a shortcut menu that can be opened by right-clicking the sample database or the test class in the navigation tree as well as by right-clicking a test in the tests list.
To run checked tests
Right-click any test in the test list to open a shortcut menu with the Run Checked Test(s) option.
To run selected tests
Right-click any test in the test list to open a shortcut menu with the Run Selected Test(s) option.
Note
To learn more about Test List Manager, see the Viewing test list topic.
In the Test Results list, the icon before the test name shows the status of the test:
Icon | Name | Description |
---|---|---|
Failed | Indicates that the test has failed | |
Succeeded | Indicates that the test has passed | |
Executing | Indicates that the test is being executed | |
Pending | Indicates that the test execution is paused |