private void AssertThatCreatedObjectReturnsDependencies(Func<ITask,ITask,SomeTask, ITask> createObject)
        {
            var finder = new TaskDependencyFinder();

            var a = new Mock<ITask>().Object;
            var b = new Mock<ITask>().Object;
            var c = new SomeTask();

            var task = createObject(a, b, c);

            IEnumerable<ITask> deps = finder.GetDependenciesFor(task);

            Assert.That(deps, Is.EquivalentTo(new [] {a, b, c}));
        }
Esempio n. 2
0
        private void AssertThatCreatedObjectReturnsDependencies(Func<ITask,ITask,SomeTask, ITask> createObject, bool areEnumerations)
        {
            var finder = new TaskDependencyFinder();

            var a = new Mock<ITask>().Object;
            var b = new Mock<ITask>().Object;
            var c = new SomeTask();

            var task = createObject(a, b, c);

            IEnumerable<TaskDependency> deps = finder.GetDependenciesFor(task);

            Assert.That(deps.Single(d => d.Name == MakeEnumerationProperty("A", areEnumerations)).Task, Is.SameAs(a));
            Assert.That(deps.Single(d => d.Name == MakeEnumerationProperty("B", areEnumerations)).Task, Is.SameAs(b));
            Assert.That(deps.Single(d => d.Name == MakeEnumerationProperty("C", areEnumerations)).Task, Is.SameAs(c));
            Assert.That(deps.Select(d => d.Task), Is.EquivalentTo(new [] {a, b, c}));
        }
Esempio n. 3
0
        private void AssertThatCreatedObjectReturnsDependencies(Func <IObsoleteTask, IObsoleteTask, SomeTask, IObsoleteTask> createObject, bool areEnumerations)
        {
            var finder = new TaskDependencyFinder();

            var a = new Mock <IObsoleteTask>().Object;
            var b = new Mock <IObsoleteTask>().Object;
            var c = new SomeTask();

            var task = createObject(a, b, c);

            IEnumerable <TaskDependency> deps = finder.GetDependenciesFor(task);

            Assert.That(deps.Single(d => d.Name == MakeEnumerationProperty("A", areEnumerations)).Task, Is.SameAs(a));
            Assert.That(deps.Single(d => d.Name == MakeEnumerationProperty("B", areEnumerations)).Task, Is.SameAs(b));
            Assert.That(deps.Single(d => d.Name == MakeEnumerationProperty("C", areEnumerations)).Task, Is.SameAs(c));
            Assert.That(deps.Select(d => d.Task), Is.EquivalentTo(new [] { a, b, c }));
        }