public void Schedule_the_child_when_one_of_its_parents_branch_is_completed_and_other_parent_branch_is_not_active_at_all()
        {
            var workflow = new WorkflowWithMultipleParents();
            var workflowHistoryEvents = CreateCompletedActivityEventGraph(_activityName, _activityVersion, _positionalName);

            var decisions = workflow.NewExecutionFor(workflowHistoryEvents).Execute();

            Assert.That(decisions, Is.EquivalentTo(new[] { new ScheduleActivityDecision(Identity.New("Transcode", "2.0")) }));
        }
        public void Does_not_schedule_the_child_when_one_of_its_parent_activity_is_active()
        {
            var workflow         = new WorkflowWithMultipleParents();
            var allHistoryEvents = _builder.ActivityCompletedGraph(Identity.New(_activityName, _activityVersion, _positionalName), "id", "res")
                                   .Concat(_builder.ActivityScheduledGraph(Identity.New(_siblingActivityName, _siblingActivityVersion)));

            var decisions = workflow.NewExecutionFor(new WorkflowHistoryEvents(allHistoryEvents)).Execute();

            CollectionAssert.IsEmpty(decisions);
        }
        public void Return_scheduling_decision_for_child_when_all_of_its_parents_are_completed()
        {
            var workflow      = new WorkflowWithMultipleParents();
            var activityGraph = _builder.ActivityCompletedGraph(Identity.New(_activityName, _activityVersion, _positionalName), "id", "res");
            var siblingGraph  = _builder.ActivityCompletedGraph(Identity.New(_siblingActivityName, _siblingActivityVersion), "id2", "re2");


            var decisions = workflow.NewExecutionFor(new WorkflowHistoryEvents(siblingGraph.Concat(activityGraph))).Execute();

            Assert.That(decisions, Is.EquivalentTo(new[] { new ScheduleActivityDecision(Identity.New("Transcode", "2.0")) }));
        }