SQL Test - 1.0

SQL Test

Working with tests - SQL Test

SQL Test runs tests depending on what is selected in the SQL Test window.

Running all tests for a database

To run all the tests for a database, ensure the database is selected in the SQL Test window, and click Run Tests:

Running a test class

To run a group of tests in a test class, ensure the test class you want to run is selected, and click Run Tests:

Running a single test

To run a single test, ensure the test you want to run is selected in the SQL Test window, and click Run Tests.

Alternatively, right-click the test, and then click Run Test:

Tip: With the database, test class, or individual test you want to run selected, you can press Alt + Shift + X to run tests.

Test status indicators

In the SQL Test window, the icon before the test name displays the status of the test:

There is no result for this test; either this is a new test you have created, or a test you have not run since you launched the SQL Test window. Tests are also reset to this status when you refresh the list of tests.

When the test was last run, it passed

When the test was last run, it failed

If you want to reset the status of all the tests in the SQL Test window, you can refresh the list of tests by clicking .

Editing a test

To script out a test as an ALTER PROCEDURE query, double-click the test in the SQL Test window.

Alternatively, you can right-click a test in the SQL Test window, and then click Edit Test.

For information on writing tests in T-SQL using the tSQLt framework, see: tSQLt User Guide.

Deleting a test

To delete a test from the database, right-click a test in the SQL Test window, and then click Delete Test:

Note: Tests are stored procedures, so deleting a test will drop the stored procedure from your database.

Was this article helpful?

Search support
Forums
Visit the SQL Test forum.