public void ExplicitTransaction6e()
{
CommittableTransaction ct = new CommittableTransaction();
IntResourceManager irm = new IntResourceManager(1);
Transaction.Current = ct;
try
{
TransactionScope scope1 = new TransactionScope();
/* Enlist */
irm.Value = 2;
TransactionScope scope2 = new TransactionScope(TransactionScopeOption.Suppress);
Assert.Throws<InvalidOperationException>(() => scope1.Dispose());
scope2.Dispose();
}
finally
{
Transaction.Current = null;
}
}