コード例 #1
0
        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.");
        }
コード例 #2
0
        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.");
        }
コード例 #3
0
        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.");
        }
コード例 #4
0
 public void TestRecreateJobs()
 {
     SchedulingSyncHelper.RecreateJobsForTenant(RequestContext.TenantId, SchedulingHelper.Instance);
 }