public static CreateTestJobSchedule ( |
||
controller | ||
context | BatchAccountContext | |
jobScheduleId | string | |
recurrenceInterval | System.TimeSpan | |
Результат | void |
public void TestListAllJobSchedules() { BatchController controller = BatchController.NewInstance; string jobScheduleId1 = "testId1"; string jobScheduleId2 = "testId2"; string jobScheduleId3 = "thirdtestId"; int count = 3; BatchAccountContext context = null; controller.RunPsTestWorkflow( () => { return(new string[] { string.Format("Test-ListAllJobSchedules '{0}' '{1}'", accountName, count) }); }, () => { 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()); }
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}'", jobSchedulePrefix, matches) }); }, () => { 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()); }
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 TestDeleteJobSchedulePipeline() { BatchController controller = BatchController.NewInstance; string jobScheduleId = "testDeleteJobSchedulePipe"; BatchAccountContext context = null; controller.RunPsTestWorkflow( () => { return(new string[] { string.Format("Test-DeleteJobSchedule '{0}' '1'", jobScheduleId) }); }, () => { context = new ScenarioTestContext(); ScenarioTestHelpers.CreateTestJobSchedule(controller, context, jobScheduleId, null); }, null, 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"); }
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); }, MethodBase.GetCurrentMethod().ReflectedType?.ToString(), MethodBase.GetCurrentMethod().Name); }