public void Test06_Attempt_To_Commit_Changes_For_ReadOnly_DbContext() { var dbContextCollection = new DbContextCollection(true); var dbContext = dbContextCollection.Get <FakeDbContext>(); var commitedChanges = dbContextCollection.Commit(); dbContext.Should().NotBeNull(); commitedChanges.Should().Be(0); }
public void Test05_Attempt_To_Commit_Changes_On_One_DbContext() { var dbContextCollection = new DbContextCollection(); var dbContext = dbContextCollection.Get <FakeDbContext>(); var commitedChanges = dbContextCollection.Commit(); dbContext.Should().NotBeNull(); commitedChanges.Should().Be(2); }
public void Test04_Attempt_To_Commit_Changes_On_Two_DbContexts() { var dbContextCollection = new DbContextCollection(); var dbContext1 = dbContextCollection.Get <FakeDbContext>(); var dbContext2 = dbContextCollection.Get <AnotherFakeDbContext>(); var commitedChanges = dbContextCollection.Commit(); dbContext1.Should().NotBeNull(); dbContext2.Should().NotBeNull(); dbContext1.InstanceId.Should().NotBe(dbContext2.InstanceId); commitedChanges.Should().Be(3); }
private int CommitInternal() { return(_dbContexts.Commit()); }
/// <summary> /// Commit all transaction. /// </summary> internal void Commit() { DbContextCollection.Commit(); }