System.Transactions.Tests.TransactionScopeTest.NestedTransactionScope13 C# (CSharp) Метод

NestedTransactionScope13() приватный Метод

private NestedTransactionScope13 ( ) : void
Результат void
        public void NestedTransactionScope13()
        {
            Assert.Throws<TransactionAbortedException>(() =>
               {
               IntResourceManager irm = new IntResourceManager(1);

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

                   using (TransactionScope scope2 = new TransactionScope())
                   {
                       irm.Value = 4;
                       /* Not completing this, so the transaction will
                        * get aborted
                       scope2.Complete (); */
                   }

                   scope.Complete();
               }
               });
        }