When dbForge SQL Tools is installed, you can start setting up the testing stage of the DevOps process. The necessary conditions for running unit tests are the following:
- tSQLt framework must be installed on the database you want to run tests on.
- Unit tests must be present in the database you want to run tests on.
tSQLt is an open-source database unit testing framework for SQL Server. To learn more about the framework, please follow this link. tSQLt framework can be installed on a database where unit tests are supposed to be run. The environment of the tSQLt framework is a set of tables, views, procedures, functions, and other objects.
Unit tests can be created right in a database to be tested or in a temporary database along with a set of scripts of their creation and subsequent use on any of tested DBs. If a set of scripts for unit tests creation is used, the set will look like a multitude of *.sql files. Some of these files are creation scripts, some are database schema creation scripts (test classes). The rest of the files are stored procedure creation scripts (test cases) within which the special methods (e.g. AssertEquals, AssertNotEquals et al.) are called from the tSQLt framework.