public void SetupRecurringJob() { // arrange var wasExecuted = false; var sut = new HangfireRecurringFixture(); HangfireHelperFixture.RegisterType(typeof(HangfireRecurringFixture), ref sut); sut.ActionToExecute += () => { wasExecuted = true; }; // act sut.Setup(); Thread.Sleep(65000); // assert wasExecuted.Should().BeTrue(); }
public void SetUpFireAndForgetJob() { // arrange var wasExecuted = false; var sut = new HangfireJobBaseFixture(); HangfireHelperFixture.RegisterType(typeof(HangfireJobBaseFixture), ref sut); sut.TestInvokeAction += () => { wasExecuted = true; }; // act sut.Setup(); //TODO - This makes the test brittle, think of a better way to do this Thread.Sleep(30000); // assert wasExecuted.Should().BeTrue(); }