public void do_as_a_delay_w_the_timespan_given() { var continuation = new DelayedRetryContinuation(5.Minutes()); var context = new TestContinuationContext(); var envelope = ObjectMother.Envelope(); continuation.Execute(envelope, context); envelope.Callback.AssertWasCalled(x => x.MoveToDelayedUntil(context.SystemTime.UtcNow().AddMinutes(5))); }
public async Task do_as_a_delay_w_the_timespan_given() { var continuation = new DelayedRetryContinuation(5.Minutes()); var context = Substitute.For <IEnvelopeContext>(); var envelope = ObjectMother.Envelope(); var now = DateTime.Today.ToUniversalTime(); await continuation.Execute(envelope, context, now); envelope.Callback.Received().MoveToDelayedUntil(now.AddMinutes(5)); }
public async Task do_as_a_delay_w_the_timespan_given() { var continuation = new DelayedRetryContinuation(5.Minutes()); var context = Substitute.For <IEnvelopeContext>(); var delayedJobs = Substitute.For <IDelayedJobProcessor>(); context.DelayedJobs.Returns(delayedJobs); var envelope = ObjectMother.Envelope(); var now = DateTime.Today.ToUniversalTime(); await continuation.Execute(envelope, context, now); delayedJobs.Received().Enqueue(now.AddMinutes(5), envelope); await envelope.Callback.Received().MarkSuccessful(); }