예제 #1
0
        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));
        }
예제 #2
0
        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));
        }
예제 #3
0
        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;
        }
예제 #4
0
        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));
        }