Exemplo n.º 1
0
        public void HasVertex()
        {
            var graph = new DiGraph <int, int>(1);

            graph.AddEdge(1, 2);
            graph.AddEdge(2, 3);
            graph.AddEdge(3, 4);
            graph.AddEdge(4, 5);
            graph.AddEdge(5, 6);
            graph.AddEdge(6, 7);
            graph.AddVertex(99);

            Assert.IsTrue(graph.HasVertex(1));
            Assert.IsTrue(graph.HasVertex(2));
            Assert.IsTrue(graph.HasVertex(3));
            Assert.IsTrue(graph.HasVertex(4));
            Assert.IsTrue(graph.HasVertex(5));
            Assert.IsTrue(graph.HasVertex(6));
            Assert.IsTrue(graph.HasVertex(7));
            Assert.IsTrue(graph.HasVertex(99));
            Assert.IsFalse(graph.HasVertex(8));
        }