Пример #1
0
        public void TrigggeredJobComplete_SetInstructionToError_TriggerSetToErrorState()
        {
            //act
            JobStore.TriggeredJobComplete(_trigger1, _job, SchedulerInstruction.SetTriggerError);

            //assert
            Assert.AreEqual(TriggerState.Error, JobStore.GetTriggerState(_trigger1.Key));
            MockedSignaler.Verify(x => x.SignalSchedulingChange(null));
        }
Пример #2
0
        public void TrigggeredJobComplete_SetInstructionToError_TriggerSetToErrorState()
        {
            //act
            JobStore.TriggeredJobComplete(_trigger1, _job, SchedulerInstruction.SetTriggerError);

            //assert
            Assert.AreEqual(TriggerState.Error, JobStore.GetTriggerState(_trigger1.Key).Result);
            MockedSignaler.Verify(x => x.SignalSchedulingChange(It.IsAny <DateTimeOffset>(), It.IsAny <CancellationToken>()));
        }
Пример #3
0
        public void TrigggeredJobComplete_SetInstructionToDeleted_TriggerIsDeletedSuccesfully()
        {
            //act
            JobStore.TriggeredJobComplete(_trigger1, _job, SchedulerInstruction.DeleteTrigger);

            //assert
            Assert.IsNull(JobStore.RetrieveTrigger(_trigger1.Key));

            MockedSignaler.Verify(x => x.SignalSchedulingChange(null));
        }
Пример #4
0
        public void TrigggeredJobComplete_SetInstructionToAllJobTriggersComplete_TriggersSetoCompleteState()
        {
            //act
            JobStore.TriggeredJobComplete(_trigger1, _job, SchedulerInstruction.SetAllJobTriggersComplete);

            //assert
            Assert.AreEqual(TriggerState.Complete, JobStore.GetTriggerState(_trigger1.Key));
            Assert.AreEqual(TriggerState.Complete, JobStore.GetTriggerState(_trigger2.Key));
            MockedSignaler.Verify(x => x.SignalSchedulingChange(null));
        }
Пример #5
0
        public void TrigggeredJobComplete_SetInstructionToDeleted_TriggerIsDeletedSuccesfully()
        {
            //act
            JobStore.TriggeredJobComplete(_trigger1, _job, SchedulerInstruction.DeleteTrigger);

            //assert
            Assert.IsNull(JobStore.RetrieveTrigger(_trigger1.Key).Result);

            MockedSignaler.Verify(x => x.SignalSchedulingChange(It.IsAny <DateTimeOffset>(), It.IsAny <CancellationToken>()));
        }
Пример #6
0
        public void TrigggeredJobComplete_SetInstructionToAllJobTriggersComplete_TriggersSetoCompleteState()
        {
            //act
            JobStore.TriggeredJobComplete(_trigger1, _job, SchedulerInstruction.SetAllJobTriggersComplete).GetAwaiter().GetResult();

            //assert
            Assert.AreEqual(TriggerState.Complete, JobStore.GetTriggerState(_trigger1.Key).Result);
            Assert.AreEqual(TriggerState.Complete, JobStore.GetTriggerState(_trigger2.Key).Result);

            MockedSignaler.Verify(x => x.SignalSchedulingChange(It.IsAny <DateTimeOffset>(), It.IsAny <CancellationToken>()));
        }