Ejemplo n.º 1
0
        public void GetNodes_ByDefault_ReturnsAnEmptyArray()
        {
            CourseDependencyGraph courseGraph = CreateCourseDependencyGraph();
            var courses = courseGraph.GetNodes();

            Assert.AreEqual(0, courses.Count());
        }
Ejemplo n.º 2
0
        public void CreateNewOrGetExistingNode_WhenCalled_ChangesCourseNodes()
        {
            CourseDependencyGraph courseGraph = CreateCourseDependencyGraph();
            Course course = courseGraph.CreateNewOrGetExistingNode(GetName());

            Assert.AreEqual(1, courseGraph.GetNodes().Count());
        }
Ejemplo n.º 3
0
        private static Course[] PlanCoursesBasedOnPrerequisites(string[] courses, string[][] courseDependencies)
        {
            CourseDependencyGraph courseGraph = BuildGraphDataStructure(courses, courseDependencies);

            return(OrderCourses(courseGraph.GetNodes()));
        }