SQL Test 4

Installing and running the example tests

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

Installing the example database

To install the example database:

  1. In SQL Server Management Studio, on the toolbar, click the SQL Test icon:

    The SQL Test tab opens:

  2. In the SQL Test tab, click Add Database to SQL Test. 

  3. On the Add Database to SQL Test dialog box, click Create sample database:
     

    The Welcome to SQL Test dialog box opens:

  4. Select the server you want to install the sample database on, and 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, make sure AcceleratorTests is selected, and click :

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

When you've 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, the messages pane to the right of the interface will display them:

Fixing the failing example test

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


Didn't find what you were looking for?