Viewing test list

To view a test list:

1. In Object Explorer, right-click a database or a specific database object, point to Unit Test, and then click View Test List.

Alternatively, go to Unit Test in the main menu and select View Test List.

2. The Test List Manager window opens.

View SQL database unit tests in the Test List Manager

There are several buttons on the Test List Manager toolbar for managing unit tests, in particular:

Click Run Checked Test(s) to run all the checked tests Run Checked Test(s) runs all the checked tests.

Click Refresh to update the test list Refresh updates the test list.

Click Add New Test to create a new test for a required database Add New Test creates a new test for a required database.

Click Delete Test to delete the selected test Delete Test deletes the selected test.

Clik Delete Test Class to delete the selected test class Delete Test Class deletes the selected test class.

Test List Manager options

The Test List Manager allows manipulating unit tests and configuring the testing process.

Run All Tests

You can select the Run All Tests option on 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.

Add New Test

You can select the Add New Test option on 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.

Uninstall Test Framework

Right-click the sample database in the navigation tree to open a shortcut menu with the Uninstall Test Framework option.

Uninstall a test framework from the List Manager of the SQL unit testing tool

Delete Test Class

Right-click the test class in the navigation tree to open a shortcut menu with the Delete Test Class option.

Rename Test Class

Right-click the test class in the navigation tree to open a shortcut menu with the Rename Test Class option.

Rename the test class from the List Manager of the SQL unit testing tool

Run Checked Test(s)

Right-click any test in the test list to open a shortcut menu with the Run Checked Test(s) option.

Run Selected Test(s)

Right-click any test in the test list to open a shortcut menu with the Run Selected Test(s) option.

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.

Delete Test

Right-click the required test in the Test List Manager and select Delete Test from the shortcut menu that appears. Then press OK to confirm deleting.

Open Test

Right-click the required test in the Test List Manager and select Open Test from the shortcut menu that appears. The test procedure script will open in the new SQL document.

Select All

Right-click any test in the Test List Manager and select Select All from the shortcut menu that appears. All tests will be selected and highlighted in yellow.

Manipulate tests from the shortcut menu of the Test List Manager