public void TestTriggerMisfiredMessage() { // expectations Expect.Call(mockLog.IsInfoEnabled).Return(true); mockLog.Info(null); LastCall.IgnoreArguments(); mockery.ReplayAll(); Trigger t = new SimpleTrigger(); plugin.TriggerMisfired(t); }
public void TestTriggerMisfiredMessage() { // arrange mockLog.Stub(log => log.IsInfoEnabled).Return(true); IOperableTrigger t = (IOperableTrigger)TriggerBuilder.Create() .WithSchedule(SimpleScheduleBuilder.Create()) .Build(); t.JobKey = new JobKey("name", "group"); // act plugin.TriggerMisfired(t); // assert mockLog.AssertWasCalled(log => log.Info(Arg <string> .Is.NotNull)); }
public async Task TestTriggerMisfiredMessage() { // arrange A.CallTo(() => mockLog.Log(LogLevel.Info, null, null, null)).Returns(true); IOperableTrigger t = (IOperableTrigger)TriggerBuilder.Create() .WithSchedule(SimpleScheduleBuilder.Create()) .Build(); t.JobKey = new JobKey("name", "group"); // act await plugin.TriggerMisfired(t); // 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(); }