Example #1
0
        public async Task just_calls_through_to_the_context_pipeline_to_do_it_again()
        {
            var continuation = RetryNowContinuation.Instance;

            var envelope = ObjectMother.Envelope();

            envelope.Attempts = 1;
            var channel = Substitute.For <IChannelCallback>();

            var root = new MockMessagingRoot();

            root.Pipeline.Invoke(envelope, channel).Returns(Task.CompletedTask);

            await continuation.Execute(root, channel, envelope, null, DateTime.UtcNow);

            await root.Pipeline.Received(1).Invoke(envelope, channel);
        }
Example #2
0
        public async Task do_as_a_delay_w_the_timespan_given()
        {
            var continuation = new ScheduledRetryContinuation(5.Minutes());
            var callback     = Substitute.For <IChannelCallback>();

            var envelope = ObjectMother.Envelope();



            var now = DateTime.Today.ToUniversalTime();

            var root = new MockMessagingRoot();
            await continuation.Execute(root, callback, envelope, null, now);

            envelope.ExecutionTime.ShouldBe(now.AddMinutes(5));

            await root.Persistence.Received().ScheduleJob(envelope);
        }