Ejemplo n.º 1
0
        public async Task A_scheduled_command_is_not_due_if_it_has_already_been_delivered_and_succeeded()
        {
            var command = new CommandScheduled <Order>
            {
                Command = new AddItem()
            };

            command.Result = new CommandSucceeded(command);

            command.IsDue().Should().BeFalse();
        }
Ejemplo n.º 2
0
        public async Task A_scheduled_command_is_due_if_no_due_time_is_specified()
        {
            var command = new CommandScheduled <Order>
            {
                Command = new AddItem()
            };

            command.IsDue()
            .Should()
            .BeTrue();
        }
Ejemplo n.º 3
0
        public async Task A_scheduled_command_is_not_due_if_a_due_time_is_specified_that_is_later_than_the_current_domain_clock()
        {
            var command = new CommandScheduled <Order>
            {
                Command = new AddItem(),
                DueTime = Clock.Now().Add(TimeSpan.FromSeconds(1))
            };

            command.IsDue()
            .Should()
            .BeFalse();
        }
Ejemplo n.º 4
0
        public async Task A_scheduled_command_is_due_if_a_due_time_is_specified_that_is_earlier_than_the_specified_clock()
        {
            var command = new CommandScheduled <Order>
            {
                Command = new AddItem(),
                DueTime = Clock.Now().Add(TimeSpan.FromDays(1))
            };

            command.IsDue(Clock.Create(() => Clock.Now().Add(TimeSpan.FromDays(2))))
            .Should()
            .BeTrue();
        }
        public async Task A_scheduled_command_is_not_due_if_it_has_already_been_delivered_and_succeeded()
        {
            var command = new CommandScheduled<Order>
            {
                Command = new AddItem()
            };
            command.Result = new CommandSucceeded(command);

            command.IsDue().Should().BeFalse();
        }
        public async Task A_scheduled_command_is_not_due_if_a_due_time_is_specified_that_is_later_than_the_current_domain_clock()
        {
            var command = new CommandScheduled<Order>
            {
                Command = new AddItem(),
                DueTime = Clock.Now().Add(TimeSpan.FromSeconds(1))
            };

            command.IsDue()
                   .Should()
                   .BeFalse();
        }
        public async Task A_scheduled_command_is_due_if_a_due_time_is_specified_that_is_earlier_than_the_specified_clock()
        {
            var command = new CommandScheduled<Order>
            {
                Command = new AddItem(),
                DueTime = Clock.Now().Add(TimeSpan.FromDays(1))
            };

            command.IsDue(Clock.Create(() => Clock.Now().Add(TimeSpan.FromDays(2))))
                   .Should()
                   .BeTrue();
        }
        public async Task A_scheduled_command_is_due_if_no_due_time_is_specified()
        {
            var command = new CommandScheduled<Order>
            {
                Command = new AddItem()
            };

            command.IsDue()
                   .Should()
                   .BeTrue();
        }