public void CreateScheduleWithNoTriggerTest( ) { var tos = new WfTriggerOnSchedule { WorkflowToRun = CreateLoggingWorkflow() }; tos.Save( ); ToDelete.Add(tos.Id); ToDelete.Add(tos.WorkflowToRun.Id); Assert.AreEqual(null, SchedulingHelper.Instance.GetJobDetail(SchedulingSyncHelper.GetJobId(tos)), "No job should be scheduled."); }
public void CreateDisabledScheduleTest( ) { var tos = new WfTriggerOnSchedule { WorkflowToRun = CreateLoggingWorkflow() }; tos.ScheduleForTrigger.Add(new ScheduleDailyRepeat { SdrTimeOfDay = SqlDateTime.MinValue.Value.AddHours(23).ToUniversalTime() }.As <Schedule>( )); tos.TriggerEnabled = false; tos.Save( ); ToDelete.Add(tos.Id); ToDelete.Add(tos.WorkflowToRun.Id); ToDelete.Add(tos.ScheduleForTrigger.First( ).Id); Assert.AreEqual(null, SchedulingHelper.Instance.GetJobDetail(SchedulingSyncHelper.GetJobId(tos)), "No job should be scheduled."); }
public void CreateScheduleThenDelete( ) { var tos = new WfTriggerOnSchedule { WorkflowToRun = CreateLoggingWorkflow() }; tos.ScheduleForTrigger.Add(new ScheduleDailyRepeat { SdrTimeOfDay = SqlDateTime.MinValue.Value.AddHours(23).ToUniversalTime() }.As <Schedule>( )); tos.Save( ); ToDelete.Add(tos.Id); ToDelete.Add(tos.WorkflowToRun.Id); ToDelete.Add(tos.ScheduleForTrigger.First( ).Id); Assert.IsNotNull(SchedulingHelper.Instance.GetJobDetail(SchedulingSyncHelper.GetJobId(tos)), "Ensure the job was scheduled"); Entity.Delete(tos); Assert.IsNull(SchedulingHelper.Instance.GetJobDetail(SchedulingSyncHelper.GetJobId(tos)), "Ensure the job was unscheduled after delete."); }
public void TestRecreateJobs() { SchedulingSyncHelper.RecreateJobsForTenant(RequestContext.TenantId, SchedulingHelper.Instance); }