I was looking to write a new test with the tsqlt framework recently. I wanted to isolate a stored procedure’s logic and planned on using the FakeFunction procedure available in tsqlt.
I wrote my test, using a template from the Pluralsight course on tsqlt and the documentation. I tried to execute the test and get a “tsqlt.fakefunction does not exist” error.
I was slightly confused at first, but checking my list of functions and stored procedures showed that I didn’t have the FakeFunction procedure available. It’s a relatively recent addition to tsqlt, so I needed and update.
After downloading the framework (a zip file), I opened it up to find this:
A number of files there, but the tsqlt.class.sql is the important one. I double clicked it from the zip and it opened in SSMS.
It’s a standard T-SQL script, albeit a long one. I executed it and it ran fine. My framework was updated to the latest version and I now had the function I needed.
Of course, I used my test to ensure this worked as expected and I was pleased to see it work well.