#region Init and Cleanup TransactionScope _trans; [TestInitialize()] public void Init() { _trans = newTransactionScope(); } [TestCleanup()] public void Cleanup() { _trans.Dispose(); }
This creates a transaction scope before each of your test methods and disposes of the transaction afterwards. During the test, everything behaves as if you actually save in the database. Afterwards, everything is as it was before!
No comments:
Post a Comment