tSQLt - need suggestion
Hi Experts,
We have plans to implement DB Unit tests with tSQLt. As part of POC, we have done below. Request you to review and provide your suggestions. Thank you.
We have a stored procedure which accepts XML as a parameter. Within the stored procedure we break the XML and store it in a temp table, then make a join with original table on unique identifier and if a record is found, update other columns of original table. If there is no record in the original table then insert a record.
we created two test cases.
1. Using faketable feature, we verify that when XML content is brand new, a record should insert. Assert expected and actual.
2. Using faketable feature, we verify that when XML content is existing, the record in original should be updated. Assert expected and actual.
Thank you.
We have plans to implement DB Unit tests with tSQLt. As part of POC, we have done below. Request you to review and provide your suggestions. Thank you.
We have a stored procedure which accepts XML as a parameter. Within the stored procedure we break the XML and store it in a temp table, then make a join with original table on unique identifier and if a record is found, update other columns of original table. If there is no record in the original table then insert a record.
we created two test cases.
1. Using faketable feature, we verify that when XML content is brand new, a record should insert. Assert expected and actual.
2. Using faketable feature, we verify that when XML content is existing, the record in original should be updated. Assert expected and actual.
Thank you.
Tagged:
Comments
We in the team unfortunately aren't experts ourselves on writing SQL tests so we may not be of much help here. If anyone in the community has any insight to offer on this, please do post a reply!
Jessica Ramos | Product Support Engineer | Redgate Software
Have you visited our Help Center?
Product Manager
Redgate Software