public void VerifyCommitThenRollbackUndoesChanges() { var outerTransaction = new EsentTransaction(this.session, "test", null); Transaction innerTransaction = new EsentTransaction(this.session, "test", outerTransaction); this.InsertRecord(1); innerTransaction.Commit(); Assert.IsTrue(this.ContainsRecord(1)); outerTransaction.Rollback(); Assert.IsFalse(this.ContainsRecord(1)); }
public void VerifyCommitPersistsChanges() { Transaction transaction = new EsentTransaction(this.session, "test", null); this.InsertRecord(1); transaction.Commit(); Assert.IsTrue(this.ContainsRecord(1)); }
public void VerifyCommitOfOuterTransactionCommitsInnerTransaction() { bool eventCalled = false; var outerTransaction = new EsentTransaction(this.session, "test", null); Transaction innerTransaction = new EsentTransaction(this.session, "test", outerTransaction); innerTransaction.Committed += () => eventCalled = true; outerTransaction.Commit(); Assert.IsTrue(eventCalled); }
public void VerifyRolledBackEventMigratesToOuterTransactionOnCommit() { bool eventCalled = false; var outerTransaction = new EsentTransaction(this.session, "test", null); Transaction innerTransaction = new EsentTransaction(this.session, "test", outerTransaction); innerTransaction.RolledBack += () => eventCalled = true; innerTransaction.Commit(); outerTransaction.Rollback(); Assert.IsTrue(eventCalled); }
public void VerifyCommittedEventIsCalledOnCommit() { bool eventCalled = false; Transaction transaction = new EsentTransaction(this.session, "test", null); transaction.Committed += () => eventCalled = true; transaction.Commit(); Assert.IsTrue(eventCalled); }