Beispiel #1
0
        public void RequiresExplicitActiveGoalIfCommandNeedsIt()
        {
            commandEnumerator.Setup(c => c.NeedsExplicitTargetGoal(It.IsAny <string>())).Returns(true);

            var factory = new DefaultSuiteFactory(parameters.Object, suiteRoot, commandEnumerator.Object);

            var goal1 = new Goal("goal1");
            var suite = factory.CreateSuite(new HashSet <Goal>(new[] { goal1 }));
        }
Beispiel #2
0
        public void AddsDefaultGoalsIfNoCustomGoalsPresent()
        {
            var factory = new DefaultSuiteFactory(parameters.Object, suiteRoot, commandEnumerator.Object);
            var suite   = factory.CreateSuite(new HashSet <Goal>());

            suite.Should().NotBeNull();
            suite.Goals.Should().HaveCount(2);
            suite.Goals.Should().Contain(new[] { Suite.DebugGoal, Suite.ReleaseGoal });
        }
Beispiel #3
0
        public void UsesFirstAvailableAsActiveGoalIfCommandDoesNotNeedIt()
        {
            commandEnumerator.Setup(c => c.NeedsExplicitTargetGoal(It.IsAny <string>())).Returns(false);

            var factory = new DefaultSuiteFactory(parameters.Object, suiteRoot, commandEnumerator.Object);

            var goal1 = new Goal("goal1");
            var suite = factory.CreateSuite(new HashSet <Goal>(new[] { goal1 }));

            suite.ActiveGoal.Should().Be(goal1);
        }
Beispiel #4
0
        private void UsesExplicitTargetGoalAsActive()
        {
            parameters.SetupGet(p => p.Goal).Returns("goal2");

            var factory = new DefaultSuiteFactory(parameters.Object, suiteRoot, commandEnumerator.Object);

            var goal1 = new Goal("goal1");
            var goal2 = new Goal("goal2");
            var suite = factory.CreateSuite(new HashSet <Goal>(new[] { goal1, goal2 }));

            suite.ActiveGoal.Should().Be(goal2);
        }
Beispiel #5
0
        public void UsesDefaultGoalIfTargetNotSpecified()
        {
            var factory = new DefaultSuiteFactory(parameters.Object, suiteRoot, commandEnumerator.Object);

            var goal1 = new Goal("goal1");
            var goal2 = new Goal("goal2");
            var goal3 = new Goal("goal3");
            var suite = factory.CreateSuite(new HashSet <Goal>(new[] { goal1, goal2, goal3 }), goal2);

            suite.Should().NotBeNull();
            suite.ActiveGoal.Should().Be(goal2);
        }
Beispiel #6
0
        public void UsesCustomGoalsIfSpecified()
        {
            var factory = new DefaultSuiteFactory(parameters.Object, suiteRoot, commandEnumerator.Object);

            var goal1 = new Goal("goal1");
            var goal2 = new Goal("goal2");
            var goal3 = new Goal("goal3");
            var suite = factory.CreateSuite(new HashSet <Goal>(new[] { goal1, goal2, goal3 }));

            suite.Should().NotBeNull();
            suite.Goals.Should().HaveCount(3);
            suite.Goals.Should().Contain(new[] { goal1, goal2, goal3 });
        }