public async Task do_as_a_delay_w_the_timespan_given()
        {
            var continuation = new ScheduledRetryContinuation(5.Minutes());
            var context      = Substitute.For <IEnvelopeContext>();


            var envelope = ObjectMother.Envelope();

            envelope.Callback = Substitute.For <IMessageCallback>();

            var now = DateTime.Today.ToUniversalTime();

            await continuation.Execute(envelope, context, now);


            envelope.Callback.Received().MoveToScheduledUntil(now.AddMinutes(5), envelope);
        }
Пример #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);
        }
        public async Task do_as_a_delay_w_the_timespan_given()
        {
            var continuation = new ScheduledRetryContinuation(5.Minutes());
            var context      = Substitute.For <IMessageContext>();


            var envelope = ObjectMother.Envelope();

            envelope.Callback = Substitute.For <IMessageCallback>();

            context.Envelope.Returns(envelope);

            var now = DateTime.Today.ToUniversalTime();

            await continuation.Execute(new MockMessagingRoot(), context, now);


#pragma warning disable 4014
            envelope.Callback.Received().MoveToScheduledUntil(now.AddMinutes(5), envelope);
#pragma warning restore 4014
        }