Ejemplo n.º 1
0
        public void TestRemoveVertexRemovesAssociatedEdges()
        {
            testGraph.RemoveVertex("a");
            Assert.IsFalse(testGraph.ContainsEdge(new E("a", "d")));

            // Make sure edges going to "a" are also gone
            Assert.IsFalse(testGraph.ContainsEdge(new E("c", "a")));
        }
Ejemplo n.º 2
0
        public void TestAddingEdge()
        {
            var reason = "graph should contain edge a->b";

            var a_b = new E("a", "b");

            testGraph.AddVertex("a");
            testGraph.AddVertex("b");
            testGraph.AddDirectedEdge(a_b);

            Assert.IsTrue(testGraph.ContainsEdge(a_b), reason);
        }