Adding New Test

To add a new test:

  1. In Database Explorer, right-click a connected database or a specific database object.
  2. Navigate to Unit Test, and then click Add New Test on the shortcut menu.

    Alternatively, go to Database in the main menu and select Add New Test.

  3. The Add New Test dialog window opens.

    Add New Test

  4. Specify a connection and database for the test to be created on.
  5. In the Test Name box, specify a name for the new test.

    Note

    If you want to create a new test with a name that already exists, Unit Test displays the Test creation failed warning message informing that there is already an object with such a name in the database.

  6. In the Class Name box, specify a class, to which the new test should be added.

    Note

    A test class is a special schema configured to include one or more related tests.

  7. Click Add Test.
  8. The test has been created, and Unit Test displays opens a query template for you to fill up using regular T-SQL. Query Template