Пример #1
0
 public void TargetShouldDisposeItsDatabase()
 {
     var tracer = new DatabaseLocalMemory();
     var testSubject = new Target(tracer);
     testSubject.Dispose();
     tracer.IsDisposed.Should().BeTrue();
 }
 public void MemoryDatabaseShouldRecordMigrationsUnapplied()
 {
     var testSubject = new DatabaseLocalMemory();
     testSubject.Unapply(Migration3);
     testSubject.Unapply(Migration2);
     testSubject.UnappliedMigrations.Should().Equal(new[] { Migration3, Migration2 });
 }
Пример #3
0
 public void ShouldChooseToGoFromDatabaseCurrentVersionToTarget()
 {
     var database = new DatabaseLocalMemory();
     database.SetCurrentVersionTo(33);
     Target.FigureOutTheGoal(database, -9).ShouldHave()
         .Properties(spec => spec.CurrentVersion, spec => spec.TargetVersion)
         .EqualTo(new {CurrentVersion = 33, TargetVersion = -9});
 }
Пример #4
0
 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 DatabaseSimulatorShouldStartVersionUnaware()
 {
     var testSubject = new DatabaseLocalMemory();
     testSubject.CurrentVersion.Result.Should().Be(-1);
 }
 public void DatabaseSimulatorShouldBeAbleToSetItsVersion()
 {
     var testSubject = new DatabaseLocalMemory();
     testSubject.SetCurrentVersionTo(33).Wait();
     testSubject.CurrentVersion.Result.Should().Be(33);
 }
 public void InMemoryDatabaseShouldDefaultToBeProductionDatabase()
 {
     var db = new DatabaseLocalMemory();
     db.IsTestDatabase.Should().BeFalse();
 }