Exemplo n.º 1
0
        public void Reschedule_lamdba_when_total_number_of_scheduling_is_less_than_allowed_limit()
        {
            var workflow = new WorkflowToRescheduleLambdaUpToALimit(2);

            _eventsBuilder.AddProcessedEvents(_eventGraphBuilder.WorkflowStartedEvent("input"));
            _eventsBuilder.AddProcessedEvents(LambdaCompletedEventGraph());
            _eventsBuilder.AddNewEvents(LambdaCompletedEventGraph());

            var decisions = workflow.Decisions(_eventsBuilder.Result());

            Assert.That(decisions, Is.EqualTo(new[] { new ScheduleLambdaDecision(Identity.Lambda(LambdaName).ScheduleId(), "input") }));
        }
Exemplo n.º 2
0
        public void Schedule_next_item_when_total_number_of_lambda_scheduled_events_exceeds_allowed_limit()
        {
            var workflow = new WorkflowToRescheduleLambdaUpToALimit(2);

            _eventsBuilder.AddProcessedEvents(_eventGraphBuilder.WorkflowStartedEvent("input"));
            _eventsBuilder.AddProcessedEvents(LambdaCompletedEventGraph());
            _eventsBuilder.AddProcessedEvents(LambdaCompletedEventGraph());
            _eventsBuilder.AddNewEvents(LambdaCompletedEventGraph());

            var decisions = workflow.Decisions(_eventsBuilder.Result());

            Assert.That(decisions, Is.EqualTo(new[] { new ScheduleActivityDecision(Identity.New(ActivityName, ActivityVersion).ScheduleId()) }));
        }
Exemplo n.º 3
0
        public void Consider_only_last_similar_events_for_lambda_when_counting_the_rescheduled_events()
        {
            var workflow = new WorkflowToRescheduleLambdaUpToALimit(2);

            _eventsBuilder.AddProcessedEvents(_eventGraphBuilder.WorkflowStartedEvent("input"));
            _eventsBuilder.AddProcessedEvents(LambdaCompletedEventGraph());
            _eventsBuilder.AddProcessedEvents(LambdaFailedEventGraph());
            _eventsBuilder.AddProcessedEvents(LambdaCompletedEventGraph());
            _eventsBuilder.AddNewEvents(LambdaCompletedEventGraph());

            var decisions = workflow.Decisions(_eventsBuilder.Result());

            Assert.That(decisions, Is.EqualTo(new[] { new ScheduleLambdaDecision(Identity.Lambda(LambdaName).ScheduleId(), "input") }));
        }