コード例 #1
0
        public void TestAddDirectEdge()
        {
            GraphWirth a        = new GraphWirth();
            bool       expected = true;

            a.AddVertex(0);
            bool actual = a.AddDirectEdge(1, 2, 0);

            Assert.AreEqual(expected, actual, "Error adding direct edge.");
        }
コード例 #2
0
        public void TestDeleteUndirectEdge_ToFrom()
        {
            GraphWirth a        = new GraphWirth();
            bool       expected = true;

            a.AddVertex(0);
            a.AddDirectEdge(1, 2, 0);
            bool actual = a.DeleteDirectEdge(2, 1);

            Assert.AreEqual(expected, actual, "Error deleting undirect edge.");
        }
コード例 #3
0
        public void TestDeleteDirectEdge_ToFrom()
        {
            GraphWirth a        = new GraphWirth();
            bool       expected = false;

            a.AddVertex(0);
            a.AddDirectEdge(1, 2, 0);
            bool actual = a.DeleteDirectEdge(2, 1);

            Assert.AreEqual(expected, actual, "Incorrect order of vertexes while deleting direct edge.");
        }