SQL Test - 1.0

SQL Test

Installing and running the example tests - SQL Test

The following example demonstrates how to install the example database and then run the example tests.

Installing the example database

To install the example database:

  1. In SQL Server Management Studio, on the Tools menu, click SQL Test.

    The SQL Test window is displayed:

    Tip: You can also open the SQL Test window by pressing Alt + Shift + Z.

  2. In the SQL Test window, click + Add Database to SQL Test:

  3. On the Add Database to SQL Test dialog box, click Install Sample Database:

    The Welcome to SQL Test dialog box is displayed:

  4. Select the server you want to install the sample database on, and then click OK.

    The tSQLt_Example database is installed, and added to the SQL Test window.

Running the example tests

The example tests are listed in the test class AcceleratorTests. To run all the tests in this class, ensure AcceleratorTests is selected in the SQL Test window, and click Run Tests:

For more information on running tests with SQL Test, see: Working with tests.

When you have run the tests, you can see that the test ready for experimentation if 2 particles failed (indicated by):

When a test fails or prints any messages, SQL Test automatically displays the SQL Test Messages window:

For more information on the Messages window, see: Viewing messages.

Fixing the failing example test

For more information on how can you fix the failing example test and start creating your own unit tests, see: After Running the Examples (tSQLt documentation).

Was this article helpful?

Search support
Forums
Visit the SQL Test forum.