public void TestStop() { factory.SchedulerFactoryType = typeof(TestSchedulerFactory); factory.AutoStartup = false; factory.AfterPropertiesSet(); factory.Stop(); TestSchedulerFactory.MockScheduler.AssertWasCalled(x => x.JobFactory = Arg <IJobFactory> .Is.NotNull); TestSchedulerFactory.MockScheduler.AssertWasCalled(x => x.Standby()); }
public void TestStop() { // set expectations TestSchedulerFactory.MockScheduler.JobFactory = null; LastCall.IgnoreArguments(); TestSchedulerFactory.MockScheduler.Standby(); TestSchedulerFactory.Mockery.ReplayAll(); factory.SchedulerFactoryType = typeof(TestSchedulerFactory); factory.AutoStartup = false; factory.AfterPropertiesSet(); factory.Stop(); }
public async Task TestStop() { factory.SchedulerFactoryType = typeof(TestSchedulerFactory); factory.AutoStartup = false; factory.AfterPropertiesSet(); await factory.Stop(); A.CallTo(TestSchedulerFactory.MockScheduler) .Where(x => x.Method.Name.Equals("set_JobFactory")) .WhenArgumentsMatch(x => x.Get <IJobFactory>(0) != null) .MustHaveHappened(); A.CallTo(() => TestSchedulerFactory.MockScheduler.Standby(A <CancellationToken> ._)).MustHaveHappened(); }