public void FaustMigrationsHistoryAccessor_Delete() { FaustMigrationHistory migrationHistory = new FaustMigrationHistory { ReleaseNumber = 2, ScriptName = "2.tony.sql", Committed = false, Successful = false, LastRun = DateTime.Now, }; _faustMigrationsHistoryAccessor.Create(migrationHistory, base.DefaultUserContext); int id = migrationHistory.FaustMigrationHistoryId; _faustMigrationsHistoryAccessor.Delete(migrationHistory, base.DefaultUserContext); FaustMigrationHistory testing; using (FaustDB db = new FaustDB(base.DefaultUserContext)) { testing = db.FaustMigrationsHistory.Where(f => f.FaustMigrationHistoryId == id).FirstOrDefault(); } Assert.IsNull(testing); }
public void FaustMigrationsHistoryAccessor_Update() { FaustMigrationHistory[] result = _faustMigrationsHistoryAccessor.FindMany(new FaustMigrationHistory { ScriptName = "1.tony.sql" }, base.DefaultUserContext); result[0].Log = "Test Client Update"; _faustMigrationsHistoryAccessor.Update(result[0], base.DefaultUserContext); int id = result[0].FaustMigrationHistoryId; FaustMigrationHistory testing; using (FaustDB db = new FaustDB(base.DefaultUserContext)) { testing = db.FaustMigrationsHistory.Where(f => f.FaustMigrationHistoryId == id).FirstOrDefault(); } Assert.IsTrue(testing.Log == "Test Client Update"); }
public override void TestInitialize() { base.TestInitialize(); _faustMigrationsHistoryAccessor = new FaustMigrationsHistoryAccessor(); _faustMigrationsHistoryAccessor.Initialize(base.DefaultUserContext); using (var db = new FaustDB(base.DefaultUserContext)) { _migrationHistory = new FaustMigrationHistory(); _migrationHistory.FaustMigrationHistoryId = 1; _migrationHistory.ReleaseNumber = 1; _migrationHistory.ScriptName = "1.tony.sql"; _migrationHistory.Committed = false; _migrationHistory.Successful = false; _migrationHistory.LastRun = DateTime.Now; db.FaustMigrationsHistory.Add(_migrationHistory); db.SaveChanges(); } }