I am writing some Unit tests against the database, and we use transactions to make sure our test data is deleted at the end.
I'm having a problem where the methods I'm testing use their own TransactionScope objects and seem to be blocked when they hit the database.
This is inside my base class:
BaseScope = new CommittableTransaction(new TransactionOptions() { IsolationLevel = IsolationLevel.ReadUnCommitted, Timeout = new System.TimeSpan(0, 5, 0) });
and then inside the method I'm testing, it does:
using (TransactionScope scope = new TransactionScope())
For the first time, when the code inside the 2nd area touches the database, it freezes. Do I have any way to solve this problem?
source
share