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

NestedTransactionScope1() private method

private NestedTransactionScope1 ( ) : void
return void
        public void NestedTransactionScope1()
        {
            IntResourceManager irm = new IntResourceManager(1);

            Assert.Null(Transaction.Current);
            using (TransactionScope scope = new TransactionScope())
            {
                irm.Value = 2;

                /* Complete this scope */
                scope.Complete();
            }

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