Transactions

Not_HappyNot_Happy Posts: 12 Bronze 1

I have just created a unit test that, because of the way our environment has been configured, drops a series of objects prior to generating the data/objects under test. In order to maintain the integrity of the database in case of issues, I am trying to wrap the text proc in a transaction so that I can at least tidy up in the event of a problem. Obviously, just wrapping the entire test in a transaction rolls the results back and so the test just reports that it succeeds. Technically, it does since everything has been rolled back, but it's also not actually testing anything. In such a case, success is not the correct answer.

What is the recommended method for including a transaction in the test?

Answers

Sign In or Register to comment.