public void MySql_CommitTransaction_HasSideEffect() { IDatabaseConnection connection = GetConnection(); InitializeDatabase(connection); var repo = new MySqlIntegrationRepository(GetConnection()); using (var transaction = repo.WithTransaction()) { repo.SprocWithSideEffect(); transaction.Commit(); } Assert.AreEqual(1, repo.GetCountOfSideEffects()); }
public void MySql_RollbackTransaction_DoesntHaveSideEffect() { IDatabaseConnection connection = GetConnection(); InitializeDatabase(connection); var repo = new MySqlIntegrationRepository(GetConnection()); using (var transaction = repo.WithTransaction()) { repo.SprocWithSideEffect(); transaction.Rollback(); } Assert.AreEqual(0, repo.GetCountOfSideEffects()); }