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"))); }
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); }