public void Commit_Calls_Commit_On_Underlying_ITransaction() { var mockTransaction = MockRepository.GenerateMock<global::NHibernate.ITransaction>(); mockTransaction.Expect(x => x.Commit()).IgnoreArguments(); var transaction = new NHTransaction(mockTransaction); transaction.Commit(); mockTransaction.VerifyAllExpectations(); }
public void Commit_Calls_Commit_On_Underlying_ITransaction() { var mockTransaction = MockRepository.GenerateMock <global::NHibernate.ITransaction>(); mockTransaction.Expect(x => x.Commit()).IgnoreArguments(); var transaction = new NHTransaction(mockTransaction); transaction.Commit(); mockTransaction.VerifyAllExpectations(); }
public void Commit_Raises_TransactionComitted_Event() { var mockTransaction = MockRepository.GenerateMock<global::NHibernate.ITransaction>(); mockTransaction.Expect(x => x.Commit()); bool commitCalled = false; bool rollbackCalled = false; var transaction = new NHTransaction(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 <global::NHibernate.ITransaction>(); mockTransaction.Expect(x => x.Commit()); bool commitCalled = false; bool rollbackCalled = false; var transaction = new NHTransaction(mockTransaction); transaction.TransactionCommitted += delegate { commitCalled = true; }; transaction.TransactionRolledback += delegate { rollbackCalled = true; }; transaction.Commit(); mockTransaction.VerifyAllExpectations(); Assert.That(commitCalled); Assert.That(!rollbackCalled); }