public async Task run_scheduled_job_locally()
        {
            var message1 = new DelayedMessage {
                Id = 1
            };
            var message2 = new DelayedMessage {
                Id = 2
            };
            var message3 = new DelayedMessage {
                Id = 3
            };


            await theRuntime.Bus.Schedule(message1, 2.Hours());

            var id = await theRuntime.Bus.Schedule(message2, 5.Seconds());

            await theRuntime.Bus.Schedule(message3, 2.Hours());

            DelayedMessageHandler.ReceivedMessages.Count.ShouldBe(0);



            DelayedMessageHandler.Received.Wait(10.Seconds());

            DelayedMessageHandler.ReceivedMessages.Single()
            .Id.ShouldBe(2);
        }
        public async Task run_scheduled_job_after_being_sent()
        {
            var message1 = new DelayedMessage {
                Id = 1
            };
            var message2 = new DelayedMessage {
                Id = 22
            };
            var message3 = new DelayedMessage {
                Id = 3
            };

            using (var sender = JasperRuntime.For <SenderApp>())
            {
                await sender.Bus.DelaySend(message1, 2.Hours());

                await sender.Bus.DelaySend(message2, 5.Seconds());

                await sender.Bus.DelaySend(message3, 2.Hours());

                DelayedMessageHandler.ReceivedMessages.Count.ShouldBe(0);

                DelayedMessageHandler.Received.Wait(10.Seconds());

                DelayedMessageHandler.ReceivedMessages.Single()
                .Id.ShouldBe(22);
            }
        }
        public void Consume(DelayedMessage message)
        {
            _source?.TrySetResult(message);

            ReceivedMessages.Add(message);
        }