public async Task One_missing_migration_should_be_identified_when_the_only_db_migration_has_not_been_executed() { var checker = new EntityFrameworkPendingMigrationsChecker <SampleDbContext>(_context); // Db is brand new, we ran no migrations var result = (await checker.GetPendingMigrationsAsync(CancellationToken.None)).ToList(); // No migrations should be identified as missing Assert.That(result, Is.EquivalentTo(new [] { "20200531210738_MissingMigration" })); }
public async Task No_missing_migration_should_be_identified_when_all_migrations_were_executed() { var checker = new EntityFrameworkPendingMigrationsChecker <SampleDbContext>(_context); // Run all the migrations, so that DB is up to date _context.Database.Migrate(); var result = (await checker.GetPendingMigrationsAsync(CancellationToken.None)).ToList(); // No migrations should be identified as missing Assert.That(result, Is.Empty); }