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") })); }
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()) })); }
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") })); }