Example #1
0
        public void TestTriggerFiredMessage()
        {
            // 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.TriggerFired(t, ctx);
        }
        public void TestTriggerFiredMessage()
        {
            // 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.TriggerFired(t, ctx);

            // assert
            mockLog.AssertWasCalled(log => log.Info(Arg <string> .Is.NotNull));
        }
Example #3
0
        public async Task TestTriggerFiredMessage()
        {
            // 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.TriggerFired(t, ctx);

            // 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();
        }