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); }
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}); }
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); }
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); }
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 }); }
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); }