public void PurityAggregateReturnsImpureIfAnySubTasksAreImpure() { var walker = new TaskWalker(); var all = new All(new ImpureTask(), new PureTask()); var ta = new TaskAggregator <TaskPurity>(dep => new TaskPurity(dep)); walker.Walk(new TaskDependency(all), ta.Before, ta.After); Assert.That(ta.Aggregate.Purity, Is.EqualTo(false)); }
public void WalkDescriptions() { var walker = new TaskWalker(); var all = new All(new PrintTask(), new PrintTask()); var ta = new TaskAggregator <TaskCount>(dep => new TaskCount(dep)); walker.Walk(new TaskDependency(all), ta.Before, ta.After); Assert.That(ta.Aggregate.Count, Is.EqualTo(3)); }
public IEnumerable<IParameter> FindParametersInTask(IObsoleteTask task) { var walker = new TaskWalker(); var parameters = new HashSet<IParameter>(); walker.Walk(new TaskDependency(task), null, dependency => { var param = dependency.Task as IParameter; if (param != null) { parameters.Add(param); } }); return parameters; }
public void WalkAggregatesButNoLoopingForever() { var walker = new TaskWalker(); var all = new All(); var allDeps = new List <IObsoleteTask> { new PrintTask(), new PrintTask(), all }; all.Tasks = allDeps; var ta = new TaskAggregator <TaskCount>(dep => new TaskCount(dep)); walker.Walk(new TaskDependency(all), ta.Before, ta.After); Assert.That(ta.Aggregate.Count, Is.EqualTo(3)); }