CreateSuite() public method

public CreateSuite ( ISet goals, Goal defaultGoal ) : Suite
goals ISet
defaultGoal Goal
return Suite
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");
            factory.CreateSuite(new HashSet<Goal>(new[] { goal1 }), Suite.DebugGoal);
        }
Beispiel #2
0
        public void AddsDefaultGoalsIfNoCustomGoalsPresent()
        {
            var factory = new DefaultSuiteFactory(parameters.Object, suiteRoot, commandEnumerator.Object);
            var suite = factory.CreateSuite(new HashSet<Goal>(), Suite.DebugGoal);

            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
        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 #5
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 }), goal1);

            suite.Should().NotBeNull();
            suite.Goals.Should().HaveCount(3);
            suite.Goals.Should().Contain(new[] { goal1, goal2, goal3 });
        }
Beispiel #6
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.DebugGoal);

            suite.ActiveGoal.Should().Be(goal2);
        }