示例#1
0
        public void TestTriggerCompleteMessage()
        {
            // expectations
            Expect.Call(mockLog.IsInfoEnabled).Return(true);
            mockLog.Info(null);
            LastCall.IgnoreArguments();

            mockery.ReplayAll();

            Trigger t = new SimpleTrigger();

            JobExecutionContext ctx = new JobExecutionContext(
                null,
                TestUtil.CreateMinimalFiredBundleWithTypedJobDetail(typeof(NoOpJob), t),
                null);

            plugin.TriggerComplete(t, ctx, SchedulerInstruction.ReExecuteJob);
        }
        public void TestTriggerCompleteMessage()
        {
            // arrange
            mockLog.Stub(log => log.IsInfoEnabled).Return(true);

            ITrigger t = TriggerBuilder.Create()
                         .WithSchedule(SimpleScheduleBuilder.Create())
                         .Build();

            IJobExecutionContext ctx = new JobExecutionContextImpl(
                null,
                TestUtil.CreateMinimalFiredBundleWithTypedJobDetail(typeof(NoOpJob), (IOperableTrigger)t),
                null);

            // act
            plugin.TriggerComplete(t, ctx, SchedulerInstruction.ReExecuteJob);

            // assert
            mockLog.AssertWasCalled(log => log.Info(Arg <string> .Is.NotNull));
        }
示例#3
0
        public async Task TestTriggerCompleteMessage()
        {
            // arrange
            A.CallTo(() => mockLog.Log(LogLevel.Info, null, null, null)).Returns(true);

            ITrigger t = TriggerBuilder.Create()
                         .WithSchedule(SimpleScheduleBuilder.Create())
                         .Build();

            IJobExecutionContext ctx = new JobExecutionContextImpl(
                null,
                TestUtil.CreateMinimalFiredBundleWithTypedJobDetail(typeof(NoOpJob), (IOperableTrigger)t),
                null);

            // act
            await plugin.TriggerComplete(t, ctx, SchedulerInstruction.ReExecuteJob);

            // assert
            A.CallTo(() => mockLog.Log(A <LogLevel> .That.IsEqualTo(LogLevel.Info), A <Func <string> > .That.IsNull(), A <Exception> .That.IsNull(), A <object[]> .That.Not.IsNull())).MustHaveHappened();
        }