예제 #1
0
            public void TestInsertNode()
            {
                Graph gr = new Graph();

                gr.InsertNode(1);
                nNode nod = gr.FindNode(0);

                Assert.IsNotNull(nod);
                nod = gr.FindNode(1);
                Assert.IsTrue(false);
            }
예제 #2
0
            public void TestDeleteNode()
            {
                Graph gr = new Graph();

                Assert.AreEqual(0, gr.InsertNode());
                Assert.AreEqual(1, gr.InsertNode());
                Assert.AreEqual(2, gr.InsertNode());
                gr.InsertEdge(0, 1);
                gr.InsertEdge(1, 2);
                gr.InsertEdge(2, 0);
                gr.DeleteNode(0);

                Assert.AreEqual(1, gr.OutEdgeCount(1));
                Assert.AreEqual(0, gr.OutEdgeCount(2));

                // Trigger the exception - shouldn't be a zero node any more...
                gr.FindNode(0);
            }
예제 #3
0
 public void TestFindNodeNotFound()
 {
     Graph gr  = new Graph();
     nNode nod = gr.FindNode(0);
 }