public void ExplicitTransaction16()
{
CommittableTransaction ct = new CommittableTransaction();
IntResourceManager irm0 = new IntResourceManager(3);
IntResourceManager irm = new IntResourceManager(1);
Assert.Null(Transaction.Current);
Transaction.Current = ct;
try
{
irm.FailPrepare = true;
irm.FailWithException = true;
irm.Value = 2;
irm0.Value = 6;
var e = Assert.Throws<TransactionAbortedException>(() => ct.Commit());
Assert.NotNull(e.InnerException);
Assert.IsType<NotSupportedException>(e.InnerException);
irm.Check(1, 0, 0, 0, "irm");
irm0.Check(0, 0, 1, 0, "irm0");
}
finally
{
Transaction.Current = null;
}
}