コード例 #1
0
        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()));
        }
コード例 #2
0
        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()));
        }