Example #1
0
 private static void TestMyGraph()
 {
     var foo = new MyGraph<int>();
     foo.Add(1);
     foo.Add(2);
     foo.Add(3);
     foreach(var item in foo.Get())
     {
         Console.WriteLine(item);
     }
 }
 public override void AddVertex(Vertex a)
 {
     if (a.VertexID == null)
     {
         a.VertexID = VertexIDCounter++.ToString();
     }
     MyGraph.Add(a);
 }
 public override void AddVertex(string name)
 {
     if (name == null)
     {
         name = VertexIDCounter++.ToString();
     }
     MyGraph.Add(new Vertex(name));
 }
Example #4
0
        public void GraphNodesCount_Equals_7()
        {
            MyGraph <GraphNodeTestClass> myGraph = new MyGraph <GraphNodeTestClass>(ArrangeMyGraph());

            myGraph.Add(new GraphNodeTestClass {
                Id = 5
            });

            Assert.True(myGraph.Count is 7);
        }