public void Test_CannotAddSameTransactionToCommitter()
        {
            //---------------Set up test pack-------------------
            TransactionCommitter       committer   = new TransactionCommitterStub();
            StubSuccessfullTransaction transaction = new StubSuccessfullTransaction();

            committer.AddTransaction(transaction);

            //--------------Assert PreConditions----------------
            Assert.AreEqual(1, committer.OriginalTransactions.Count);

            //---------------Execute Test ----------------------
            committer.AddTransaction(transaction);

            //---------------Test Result -----------------------
            Assert.AreEqual(1, committer.OriginalTransactions.Count);
        }
        public void TestCommitAddedTransactions()
        {
            //---------------Set up test pack-------------------
            TransactionCommitter       committer      = new TransactionCommitterStub();
            StubSuccessfullTransaction transactional1 = new StubSuccessfullTransaction();

            committer.AddTransaction(transactional1);
            StubSuccessfullTransaction transactional2 = new StubSuccessfullTransaction();

            committer.AddTransaction(transactional2);
            //---------------Execute Test ----------------------
            List <Guid> executedTransactions = committer.CommitTransaction();

            //---------------Test Result -----------------------
            Assert.AreEqual(2, executedTransactions.Count);
            Assert.IsTrue(transactional1.Committed);
            Assert.IsTrue(transactional2.Committed);
        }
 public void TestCommitAddedTransactions()
 {
     //---------------Set up test pack-------------------
     TransactionCommitter committer = new TransactionCommitterStub();
     StubSuccessfullTransaction transactional1 = new StubSuccessfullTransaction();
     committer.AddTransaction(transactional1);
     StubSuccessfullTransaction transactional2 = new StubSuccessfullTransaction();
     committer.AddTransaction(transactional2);
     //---------------Execute Test ----------------------
     List<Guid> executedTransactions  = committer.CommitTransaction();
     //---------------Test Result -----------------------
     Assert.AreEqual(2, executedTransactions.Count);
     Assert.IsTrue(transactional1.Committed);
     Assert.IsTrue(transactional2.Committed);
 }
        public void Test_CannotAddSameTransactionToCommitter()
        {
            //---------------Set up test pack-------------------
            TransactionCommitter committer = new TransactionCommitterStub();
            StubSuccessfullTransaction transaction = new StubSuccessfullTransaction();
            committer.AddTransaction(transaction);

            //--------------Assert PreConditions----------------            
            Assert.AreEqual(1, committer.OriginalTransactions.Count);

            //---------------Execute Test ----------------------
            committer.AddTransaction(transaction);

            //---------------Test Result -----------------------
            Assert.AreEqual(1, committer.OriginalTransactions.Count);
        }