Esempio n. 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);
        }
Esempio n. 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});
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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 });
        }
Esempio n. 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);
        }