public void DatabaseSimulatorShouldBeAbleToSetItsVersion() { var testSubject = new DatabaseLocalMemory(); testSubject.SetCurrentVersionTo(33).Wait(); testSubject.CurrentVersion.Result.Should().Be(33); }
private static void PlanToGoBetweenVersions(int currentVersion, int?targetVersion) { var databaseLocalMemory = new DatabaseLocalMemory(); ChangePlanner.MakePlan(databaseLocalMemory, new ChangeGoal(currentVersion, targetVersion), TestData.Migrations(3, 4, 5).ToLoaders()); }
public void MemoryDatabaseShouldRecordMigrationsUnapplied() { var testSubject = new DatabaseLocalMemory(); testSubject.Unapply(Migration3); testSubject.Unapply(Migration2); testSubject.UnappliedMigrations.Should().Equal(Migration3, Migration2); }
public void ShouldChooseToGoFromDatabaseCurrentVersionToTarget() { var database = new DatabaseLocalMemory(); database.SetCurrentVersionTo(33); Target.FigureOutTheGoal(database, -9).Should().BeEquivalentTo(new { CurrentVersion = 33, TargetVersion = -9 }, options => options.ExcludingMissingMembers()); }
public void TargetShouldDisposeItsDatabase() { var tracer = new DatabaseLocalMemory(); var testSubject = new Target(tracer); testSubject.Dispose(); tracer.IsDisposed.Should().BeTrue(); }
public void Setup() { _database = new DatabaseLocalMemory(); _definedMigrations = TestData.Migrations(1, 2, 3, 4); }
public void DatabaseSimulatorShouldStartVersionUnaware() { var testSubject = new DatabaseLocalMemory(); testSubject.CurrentVersion.Result.Should().Be(-1); }
public void InMemoryDatabaseShouldDefaultToBeProductionDatabase() { var db = new DatabaseLocalMemory(); db.IsTestDatabase.Should().BeFalse(); }