DeleteJobSchedule() public static method

Deletes a job schedule used in a Scenario test.
public static DeleteJobSchedule ( BatchController controller, BatchAccountContext context, string jobScheduleId ) : void
controller BatchController
context BatchAccountContext
jobScheduleId string
return void
        public void TestListJobSchedulesWithMaxCount()
        {
            BatchController     controller     = BatchController.NewInstance;
            string              jobScheduleId1 = "testId1";
            string              jobScheduleId2 = "testId2";
            string              jobScheduleId3 = "thirdtestId";
            int                 maxCount       = 1;
            BatchAccountContext context        = null;

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-ListJobSchedulesWithMaxCount '{0}'", maxCount) }); },
                () =>
            {
                context = new ScenarioTestContext();
                ScenarioTestHelpers.CreateTestJobSchedule(controller, context, jobScheduleId1, null);
                ScenarioTestHelpers.CreateTestJobSchedule(controller, context, jobScheduleId2, null);
                ScenarioTestHelpers.CreateTestJobSchedule(controller, context, jobScheduleId3, null);
            },
                () =>
            {
                ScenarioTestHelpers.DeleteJobSchedule(controller, context, jobScheduleId1);
                ScenarioTestHelpers.DeleteJobSchedule(controller, context, jobScheduleId2);
                ScenarioTestHelpers.DeleteJobSchedule(controller, context, jobScheduleId3);
            },
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }
示例#2
0
        public void TestListJobSchedulesByFilter()
        {
            BatchController     controller        = BatchController.NewInstance;
            string              jobScheduleId1    = "testId1";
            string              jobScheduleId2    = "testId2";
            string              jobScheduleId3    = "thirdtestId";
            string              jobSchedulePrefix = "testId";
            int                 matches           = 2;
            BatchAccountContext context           = null;

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-ListJobSchedulesByFilter '{0}' '{1}' '{2}'", accountName, jobSchedulePrefix, matches) }); },
                () =>
            {
                context = ScenarioTestHelpers.GetBatchAccountContextWithKeys(controller, accountName);
                ScenarioTestHelpers.CreateTestJobSchedule(controller, context, jobScheduleId1, null);
                ScenarioTestHelpers.CreateTestJobSchedule(controller, context, jobScheduleId2, null);
                ScenarioTestHelpers.CreateTestJobSchedule(controller, context, jobScheduleId3, null);
            },
                () =>
            {
                ScenarioTestHelpers.DeleteJobSchedule(controller, context, jobScheduleId1);
                ScenarioTestHelpers.DeleteJobSchedule(controller, context, jobScheduleId2);
                ScenarioTestHelpers.DeleteJobSchedule(controller, context, jobScheduleId3);
            },
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }
示例#3
0
        public void TestListJobsUnderSchedule()
        {
            BatchController controller    = BatchController.NewInstance;
            string          jobScheduleId = "testJobSchedule";
            string          jobId         = null;
            string          jobId2        = null;
            string          runOnceJob    = "runOnceId";

            BatchAccountContext context = null;

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-ListJobsUnderSchedule '{0}' '{1}' '{2}' '{3}'", accountName, jobScheduleId, jobId, 2) }); },
                () =>
            {
                TimeSpan recurrence = TimeSpan.FromMinutes(1);
                context             = ScenarioTestHelpers.GetBatchAccountContextWithKeys(controller, accountName);
                ScenarioTestHelpers.CreateTestJob(controller, context, runOnceJob);
                ScenarioTestHelpers.CreateTestJobSchedule(controller, context, jobScheduleId, recurrence);
                jobId = ScenarioTestHelpers.WaitForRecentJob(controller, context, jobScheduleId);
                ScenarioTestHelpers.TerminateJob(controller, context, jobId);
                jobId2 = ScenarioTestHelpers.WaitForRecentJob(controller, context, jobScheduleId, jobId);
            },
                () =>
            {
                ScenarioTestHelpers.DeleteJob(controller, context, runOnceJob);
                ScenarioTestHelpers.DeleteJob(controller, context, jobId);
                ScenarioTestHelpers.DeleteJob(controller, context, jobId2);
                ScenarioTestHelpers.DeleteJobSchedule(controller, context, jobScheduleId);
            },
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }
        public void TestGetAndListJobSchedulesWithSelect()
        {
            BatchController     controller = BatchController.NewInstance;
            BatchAccountContext context    = null;
            string jobScheduleId           = "selectTest";

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-GetAndListJobSchedulesWithSelect '{0}'", jobScheduleId) }); },
                () =>
            {
                context = new ScenarioTestContext();
                ScenarioTestHelpers.CreateTestJobSchedule(controller, context, jobScheduleId, null);
            },
                () =>
            {
                ScenarioTestHelpers.DeleteJobSchedule(controller, context, jobScheduleId);
            },
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }
        private void TestTerminateJobSchedule(bool usePipeline)
        {
            BatchController     controller = BatchController.NewInstance;
            BatchAccountContext context    = null;
            string jobScheduleId           = "testTerminateJobSchedule" + (usePipeline ? "Pipeline" : "Id");

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-TerminateJobSchedule '{0}' '{1}'", jobScheduleId, usePipeline ? 1 : 0) }); },
                () =>
            {
                context = new ScenarioTestContext();
                ScenarioTestHelpers.CreateTestJobSchedule(controller, context, jobScheduleId, null);
            },
                () =>
            {
                ScenarioTestHelpers.DeleteJobSchedule(controller, context, jobScheduleId);
            },
                TestUtilities.GetCallingClass(),
                usePipeline ? "TestTerminateJobSchedulePipeline" : "TestTerminateJobScheduleById");
        }
示例#6
0
        public void TestGetJobScheduleById()
        {
            BatchController     controller    = BatchController.NewInstance;
            string              jobScheduleId = "testId";
            BatchAccountContext context       = null;

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-GetJobScheduleById '{0}' '{1}'", accountName, jobScheduleId) }); },
                () =>
            {
                context = ScenarioTestHelpers.GetBatchAccountContextWithKeys(controller, accountName);
                ScenarioTestHelpers.CreateTestJobSchedule(controller, context, jobScheduleId, null);
            },
                () =>
            {
                ScenarioTestHelpers.DeleteJobSchedule(controller, context, jobScheduleId);
            },
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }
        public void TestDisableEnableTerminateJobSchedule()
        {
            BatchController controller = BatchController.NewInstance;
            string jobScheduleId = "testDisableEnableTerminateJobSchedule";

            BatchAccountContext context = null;
            controller.RunPsTestWorkflow(
                () => { return new string[] { string.Format("Test-DisableEnableTerminateJobSchedule '{0}'", jobScheduleId) }; },
                () =>
                {
                    context = new ScenarioTestContext();
                    ScenarioTestHelpers.CreateTestJobSchedule(controller, context, jobScheduleId, null);
                },
                () =>
                {
                    ScenarioTestHelpers.DeleteJobSchedule(controller, context, jobScheduleId);
                },
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }
        public void TestDisableEnableTerminateJobSchedule()
        {
            BatchController controller    = BatchController.NewInstance;
            string          jobScheduleId = "testDisableEnableTerminateJobSchedule";

            BatchAccountContext context = null;

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-DisableEnableTerminateJobSchedule '{0}'", jobScheduleId) }); },
                () =>
            {
                context = new ScenarioTestContext();
                ScenarioTestHelpers.CreateTestJobSchedule(controller, context, jobScheduleId, null);
            },
                () =>
            {
                ScenarioTestHelpers.DeleteJobSchedule(controller, context, jobScheduleId);
            },
                MethodBase.GetCurrentMethod().ReflectedType?.ToString(),
                MethodBase.GetCurrentMethod().Name);
        }