Install and run the example tests

The guide describes how to install a sample database and then run the tests included with it.

Install a sample database

1. Open the Install Sample Database dialog by selecting Database > Unit Test > Install Sample Database.

Install a sample database with examples of tests provided by tSQLt

2. Select the server to install the sample database.

Tip

The default database name is tSQLt_Example. To use a different name, enter it in the Database field.

3. Click Install to install the sample database.

When the installation is complete, a confirmation message appears:
The sample framework has been successfully installed.

4. Click Finish to close the dialog.

The sample database appears under the specified server connection in Database Explorer.

Run sample tests

You can run all tests at once from Database Explorer or choose to run all or selected tests from Test List Manager.

Run tests from Database Explorer

In Database Explorer, right-click the sample database and select Unit Test > Run All Tests.

This operation runs all tests at once and displays their results in the Test Results grid, including the test status, name, class name, execution time, and error messages (if any).

Test Results

Run tests from Database Explorer - Programmability node

1. In Database Explorer, expand the sample database, then expand Programmability > Procedures.

2. Right-click a required test and select Unit Test > Run Test.

To run all tests, right-click the Procedures node and select Unit Test > Run All Tests.

Run tests from Test List Manager

1. Open Test List Manager by doing one of the following:

  • On the top menu, select Database > Unit Test > View Test List.
  • In Database Explorer, right-click the sample database and select Unit Test > View Test List.

2. On the Test List Manager toolbar, choose a server connection.

3. In the test projects tree, select the checkboxes next to the sample database and its AcceleratorTests.

By default, all tests are selected to run.

4. To run tests with selected checkboxes, right-click the grid and select Run Checked Test(s).

5. To run the tests highlighted in the grid, right-click the grid and select Run Selected Test(s).

Tip

To highlight multiple tests, hold down Ctrl and click each test.

Run the checked tests