public void ExplicitTransaction15()
{
CommittableTransaction ct = new CommittableTransaction();
IntResourceManager irm = new IntResourceManager(1);
IntResourceManager irm2 = new IntResourceManager(3);
Assert.Null(Transaction.Current);
Transaction.Current = ct;
try
{
Assert.Throws<InvalidOperationException>(() =>
{
using (TransactionScope scope = new TransactionScope())
{
irm.Value = 2;
Transaction.Current = new CommittableTransaction();
irm2.Value = 6;
}
});
irm.Check(0, 0, 1, 0, "irm");
irm2.Check(0, 0, 1, 0, "irm2");
}
finally
{
Transaction.Current = null;
}
}