public void breaks_appliction_on_first_query_failure() { var scope = new TestableMigrationScope(); var migrator = new DataBossMigrator(_ => scope); scope.OnExecute += _ => false; Check.That(() => migrator.ApplyRange(new[] { TextMigration("1\nGO\n2"), }) == false); Check.That( () => scope.ExecutedQueries.Count == 1, () => string.Join(" - ", scope.ExecutedQueries) == "1"); }
public void stops_application_when_migration_scope_is_faulted() { var scope = new TestableMigrationScope(); var migrator = new DataBossMigrator(_ => scope); scope.OnExecute += _ => false; Check.That(() => migrator.ApplyRange(new[] { TextMigration("First!"), TextMigration("Second!"), }) == false); Check.That( () => scope.ExecutedQueries.Count == 1, () => scope.ExecutedQueries.SequenceEqual(new[] { "First!" })); }