System.Transactions.Tests.TransactionScopeTest.NestedTransactionScope2 C# (CSharp) Method

NestedTransactionScope2() private method

private NestedTransactionScope2 ( ) : void
return void
        public void NestedTransactionScope2()
        {
            IntResourceManager irm = new IntResourceManager(1);
            Assert.Null(Transaction.Current);
            using (TransactionScope scope = new TransactionScope())
            {
                irm.Value = 2;

                /* Not-Completing this scope */
            }

            Assert.Null(Transaction.Current);
            /* Value = 2, got rolledback */
            Assert.Equal(irm.Value, 1);
            irm.Check(0, 0, 1, 0, "irm");
        }