public void GivenNoTasks_ReturnNoTasks() { var target = new TaskSorter(); var result = target.Sort(); Assert.That(!result.Any()); }
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" })); }
public void GivenDependentTasks_ReturnTasksInRequiredOrder() { var target = new TaskSorter("[a,b]", "[a => b]"); var result = target.Sort(); Assert.That(result, Is.EqualTo(new[] { "b", "a" })); }
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" })); }
public void GivenUnrelatedTasks_ReturnTasksInSameOrder() { var target = new TaskSorter("[a,b]"); var result = target.Sort(); Assert.That(result, Is.EqualTo(new[] { "a", "b" })); }