Exemple #1
0
        public async Task When_a_command_is_undelivered_it_can_be_retrieved_from_the_bus_before_it_is_due()
        {
            using (var clock = VirtualClock.Start())
            {
                var bus = new InMemoryCommandBus <string>(clock);

                await bus.Schedule("undelivered",
                                   dueTime : clock.Now().AddDays(2));

                bus.Undelivered().Should().HaveCount(1);

                bus.Undelivered().Single().Command.Should().Be("undelivered");
            }
        }
Exemple #2
0
        public async Task When_a_command_is_undelivered_it_can_be_retrieved_from_the_bus_after_it_is_due()
        {
            using (var clock = VirtualClock.Start())
            {
                var bus = new InMemoryCommandBus <string>(clock);

                await bus.Schedule("undelivered",
                                   1.Seconds());

                await clock.AdvanceBy(3.Days());

                bus.Undelivered().Should().HaveCount(1);

                bus.Undelivered().Single().Command.Should().Be("undelivered");
            }
        }