Esempio n. 1
0
        public void GivenNoTasks_ReturnNoTasks()
        {
            var target = new TaskSorter();
            var result = target.Sort();

            Assert.That(!result.Any());
        }
Esempio n. 2
0
        public void GivenTaskWithManyDependencies_ReturnTasksInRequiredOrder()
        {
            var target = new TaskSorter("[a,b,c]", "[a => b,a => c]");
            var result = target.Sort();

            Assert.That(result, Is.EqualTo(new[] { "b", "c", "a" }));
        }
Esempio n. 3
0
        public void GivenDependentTasks_ReturnTasksInRequiredOrder()
        {
            var target = new TaskSorter("[a,b]", "[a => b]");
            var result = target.Sort();

            Assert.That(result, Is.EqualTo(new[] { "b", "a" }));
        }
Esempio n. 4
0
        public void GivenMultipleDependencies_DoPrioritisedTasksFirst()
        {
            var target = new TaskSorter("[a,b,c,d]", "[a => b,c => d]");
            var result = target.Sort();

            Assert.That(result, Is.EqualTo(new[] { "b", "a", "d", "c" }));
        }
Esempio n. 5
0
        public void GivenUnrelatedTasks_ReturnTasksInSameOrder()
        {
            var target = new TaskSorter("[a,b]");
            var result = target.Sort();

            Assert.That(result, Is.EqualTo(new[] { "a", "b" }));
        }