This topic describes a sample failed test case and explains how to resolve it.
This example demonstrates a failure in the tSQLt.AssertLike stored procedure. The test compares the actual return value (N'Test') with the expected pattern (N'Test%T'). The result is displayed in the Test Results window.
The test fails because the actual value 'Test' does not match the expected pattern N'Test%T'.
The Error Message column displays the text 'Fail'. This message can be customized by setting the @Message parameter in the AssertLike procedure.

To fix the failed test:
1. In the Test Results grid, double-click the test.
Alternatively, right-click the test and select Open Test.
This opens the source code for the AssertLike test in SQL Editor.
2. Modify test by changing the actual value to N'Test%' instead of N'Test'.
3. Re-run the test.
The test should now pass because the actual return value matches the expected pattern.

Note
You can also use dbForge AI Assistant to fix failed tests.
Download dbForge Studio for SQL Server and try it absolutely free for 30 days!