public void Test_RemoveEdge() { GraphVizProcessor gvp = new GraphVizProcessor(); gvp.graph = new Graph(GraphType.Digraph, new Stmt_list()); gvp.AddEdge("a", "b"); gvp.RemoveEdge("a", "b"); if (gvp.EdgeExists("a", "b")) { Assert.Fail("Edge found after removal."); } if (!gvp.NodeExists("a")) { Assert.Fail("Node not found after edge removal."); } if (!gvp.NodeExists("b")) { Assert.Fail("Node not found after edge removal."); } }
public void Test_ClearGraph() { GraphVizProcessor gvp = new GraphVizProcessor(); gvp.graph = new Graph(GraphType.Digraph, new Stmt_list()); gvp.AddNode("a"); gvp.ClearGraph(); if (gvp.NodeExists("a")) { Assert.Fail("Node found after clearing graph."); } }
public void Test_NodeExists() { GraphVizProcessor gvp = new GraphVizProcessor(); gvp.graph = new Graph(GraphType.Digraph, new Stmt_list()); //Node exists gvp.AddNode("a"); if (!gvp.NodeExists("a")) { Assert.Fail("Node not found."); } //Node is part of an edge gvp.AddEdge("a", "b"); if (!gvp.NodeExistsInEdge("a")) { Assert.Fail("Node in an edge not found."); } }