How to fix failed tests in dbForge Studio for SQL Server

Last modified: October 1, 2024

This topic describes an example of the failed test and the way to fix it.

The following image demonstrates a test case, which is implemented as the tSQLt.AssertLike stored procedure. The test compares the return result (N’Test’) with an expected pattern N’Test%T’. The result of running the test is displayed in the Test Result window.

The test has failed because the return result ‘Test’ does not match the expected pattern N’Test%T’.

The window also shows the error message ‘Fail’. The message output is an optional feature, which can be implemented by defining the Message parameter of the AssertLike procedure.

Test Failed

To fix the failed test

1. Double-click the test or right-click the test and select Open Test. The source code for the AssertLike test will be displayed.

2. Modify the source code by writing N’Test%’ instead of N’Test’, as shown in the following image, and run the test again.

As you can see, the test has succeeded because now the return result matches the expected value.

Test Succeded

Download dbForge Studio for SQL Server and try it absolutely free for 30 days!