コード例 #1
0
        public void Test_RemoveNode()
        {
            GraphVizProcessor gvp = new GraphVizProcessor();

            gvp.graph = new Graph(GraphType.Digraph, new Stmt_list());

            gvp.AddNode("a");
            gvp.RemoveNode("a");
            if (gvp.NodeExists("a"))
            {
                Assert.Fail("Node found after removal.");
            }

            gvp.AddEdge("a", "b");
            gvp.RemoveNode("a");
            if (gvp.NodeExists("a"))
            {
                Assert.Fail("Node found after removal.");
            }
            if (!gvp.NodeExists("b"))
            {
                Assert.Fail("Second node of and edge not found.");
            }
        }