public void TestEndLoadBecause_NoTables(DatabaseType type) { var database = GetCleanedServer(type); Assert.AreEqual(0, database.DiscoverTables(false).Length); var ender = new PrematureLoadEnder(); ender.ConditionsToTerminateUnder = PrematureLoadEndCondition.NoRecordsInAnyTablesInDatabase; ender.ExitCodeToReturnIfConditionMet = ExitCodeType.OperationNotRequired; ender.Initialize(database, LoadStage.AdjustRaw); Assert.AreEqual(ExitCodeType.OperationNotRequired, ender.Mutilate(new ThrowImmediatelyDataLoadJob())); }
public void TestEndLoadBecause_NoRows(DatabaseType type) { var database = GetCleanedServer(type); DataTable dt = new DataTable(); dt.Columns.Add("Fish"); database.CreateTable("MyTable", dt); var ender = new PrematureLoadEnder(); ender.ConditionsToTerminateUnder = PrematureLoadEndCondition.NoRecordsInAnyTablesInDatabase; ender.ExitCodeToReturnIfConditionMet = ExitCodeType.OperationNotRequired; ender.Initialize(database, LoadStage.AdjustRaw); Assert.AreEqual(ExitCodeType.OperationNotRequired, ender.Mutilate(new ThrowImmediatelyDataLoadJob())); }