I’m creating various unit tests for our database using the tSQLt framework. Many of our stored procedures insert records into various tables. These procedures directly call our sequences to create IDs for the records to be inserted:
SET tID = NEXT VALUE dbo.TableName_SEQ
When creating a unit test for procedures that reference this sequence, I tried to use tSQLt.RemoveObject, but receive the error:
Object '[dbo].[TableName_SEQ]' cannot be renamed because the object participates in enforced dependencies.
As the procedure I’m testing uses this sequence directly, how should I handle this? Is there any type of tSQLt object that can fake the sequence like ‘FakeFunction’ and input the desired ID every time it’s ran?