public void Commit_Calls_Commit_On_Underlying_ITransaction() { var mockTransaction = MockRepository.GenerateMock<IDbTransaction>(); mockTransaction.Expect(x => x.Commit()).IgnoreArguments(); var transaction = new EFTransaction(mockTransaction); transaction.Commit(); mockTransaction.VerifyAllExpectations(); }
public void Commit_Calls_Commit_On_Underlying_ITransaction() { var mockTransaction = MockRepository.GenerateMock <IDbTransaction>(); mockTransaction.Expect(x => x.Commit()).IgnoreArguments(); var transaction = new EFTransaction(mockTransaction); transaction.Commit(); mockTransaction.VerifyAllExpectations(); }
public void Commit_Raises_TransactionComitted_Event() { var mockTransaction = MockRepository.GenerateMock<IDbTransaction>(); mockTransaction.Expect(x => x.Commit()); bool commitCalled = false; bool rollbackCalled = false; var transaction = new EFTransaction(mockTransaction); transaction.TransactionCommitted += delegate { commitCalled = true; }; transaction.TransactionRolledback += delegate { rollbackCalled = true; }; transaction.Commit(); mockTransaction.VerifyAllExpectations(); Assert.That(commitCalled); Assert.That(!rollbackCalled); }
public void Commit_Raises_TransactionComitted_Event() { var mockTransaction = MockRepository.GenerateMock <IDbTransaction>(); mockTransaction.Expect(x => x.Commit()); bool commitCalled = false; bool rollbackCalled = false; var transaction = new EFTransaction(mockTransaction); transaction.TransactionCommitted += delegate { commitCalled = true; }; transaction.TransactionRolledback += delegate { rollbackCalled = true; }; transaction.Commit(); mockTransaction.VerifyAllExpectations(); Assert.That(commitCalled); Assert.That(!rollbackCalled); }