public void Schedule_the_child_item_when_one_of_its_immediate_parents_last_action_is_ignore_action_with_flag_to_keep_branch_inactive()
        {
            var bookHotelActivityCompletedGraph = CompletedActivityGraph(BookHotelActivity);
            var addDinnerActivity = CompletedActivityGraph(AddDinnerActivity);
            var bookFlightActivityCompletedGraph = CompletedActivityGraph(BookFlightActivity);
            var chooseSeatActivityCompletedGraph = CompletedActivityGraph(ChooseSeatActivity);
            var allEvents =
                addDinnerActivity.Concat(bookHotelActivityCompletedGraph)
                .Concat(bookFlightActivityCompletedGraph)
                .Concat(chooseSeatActivityCompletedGraph);

            var decisions =
                new WorkflowHasImmediateParentWithIgnoreActionToKeepBranchInactive().NewExecutionFor(new WorkflowHistoryEvents(allEvents,
                                                                                                                               addDinnerActivity.Last().EventId, addDinnerActivity.First().EventId)).Execute();

            Assert.That(decisions, Is.EqualTo(new[] { new ScheduleActivityDecision(Identity.New(ChargeCustomerActivity, Version)) }));
        }
        public void Does_not_schedule_the_child_item_when_one_of_its_parent_branch_is_active_because_it_is_reexecuting()
        {
            var bookFlightActivityCompletedGraph   = CompletedActivityGraph(BookFlightActivity);
            var chooseSeatActivityCompletedGraph   = CompletedActivityGraph(ChooseSeatActivity);
            var reebokFlightActicityCompletedGraph = CompletedActivityGraph(BookFlightActivity);
            var bookHotelActivityCompletedGraph    = CompletedActivityGraph(BookHotelActivity);
            var addDinnerActivity = CompletedActivityGraph(AddDinnerActivity);

            var allEvents =
                addDinnerActivity.Concat(bookHotelActivityCompletedGraph)
                .Concat(reebokFlightActicityCompletedGraph)
                .Concat(chooseSeatActivityCompletedGraph)
                .Concat(bookFlightActivityCompletedGraph);
            var workflow = new WorkflowHasImmediateParentWithIgnoreActionToKeepBranchInactive();

            var decisions = workflow.NewExecutionFor(new WorkflowHistoryEvents(allEvents,
                                                                               addDinnerActivity.Last().EventId, addDinnerActivity.First().EventId)).Execute();

            Assert.That(decisions, Is.Empty);
        }