예제 #1
0
        public void RegioGraaf_a_TestAllPaths_OnGraph14_1_AfterDijkstra()
        {
            // Arrange
            IGraph graph = DSBuilder.CreateGraph14_1();

            graph.Dijkstra("V0");

            //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
            // NOTE: Since there are no regions, we expect
            // this test to succeed also on when
            // Dijkstra is changed for RegioGraaf!
            //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

            var expected = StringWithoutSpaces(
                "V0;V1<-V0;V2<-V3<-V0;" +
                "V3<-V0;V4<-V3<-V0;" +
                "V5<-V6<-V3<-V0;" +
                "V6<-V3<-V0;");

            // Act
            string actual = StringWithoutSpaces(graph.AllPaths());

            // Assert
            Assert.AreEqual(expected, actual);
        }
예제 #2
0
        public void RegioGraaf_a_TestAllPaths_OnGraph14_1()
        {
            // Arrange
            IGraph graph    = DSBuilder.CreateGraph14_1();
            string expected = "V0;V1;V2;V3;V4;V5;V6;";

            // Act
            string actual = StringWithoutSpaces(graph.AllPaths());

            // Assert
            Assert.AreEqual(expected, actual);
        }
예제 #3
0
        public void RegioGraaf_a_TestAllPaths_OnEmptyGraph() //<---- not for students
        {
            // Arrange
            IGraph graph    = DSBuilder.CreateGraphEmpty();
            string expected = "";

            // Act
            string actual = StringWithoutSpaces(graph.AllPaths());

            // Assert
            Assert.AreEqual(expected, actual);
        }
예제 #4
0
        public void RegioGraaf_d_Dijkstra_2_OnOtherGraph_1_AllPaths()
        {
            // Arrange
            IGraph graph    = BuildGraphOther();
            var    expected = StringWithoutSpaces(
                "A; B <- A; C <- B <- A;" +
                "D <- C <- B <- A;" +
                "E <- C <- B <- A;" +
                "F <- E <- C <- B <- A;");

            // Act
            graph.Dijkstra("A");
            string actual = StringWithoutSpaces(graph.AllPaths());

            // Assert
            Assert.AreEqual(expected, actual);
        }
예제 #5
0
        public void RegioGraaf_d_Dijkstra_1_OnGraphFromExercise_1_AllPaths()
        {
            // Arrange
            IGraph graph    = BuildGraph_FromExercise();
            var    expected = TestUtils.TrimmedStringWithoutSpaces(
                "A; B <- A; C <- A; " +
                "D <- E <- C <- A; " +
                "E <- C <-A; F <- B <- A; " +
                "G <- A;");

            // Act
            graph.RegioDijkstra("A");
            string actual = TestUtils.TrimmedStringWithoutSpaces(graph.AllPaths());

            // Assert
            Assert.AreEqual(expected, actual);
        }