예제 #1
0
        public void testSetEdgeDataBothNull()
        {
            AdjacencyListGraph <string, string> g = graph(n1, n2);

            g.AddEdge(e1);
            g.ReplaceEdge <string, string, string>(null, null);
        }
예제 #2
0
        public void testSetEdgeDataDuplicate()
        {
            AdjacencyListGraph <string, string> g = graph(n1, n2, n3, n4);
            Edge <string, string> e1 = new Edge <string, string>(n1, n2, "one");
            Edge <string, string> e2 = new Edge <string, string>(n1, n2, "two");

            g.AddEdge(e1); g.AddEdge(e2);
            g.ReplaceEdge(e1, "two");
        }
예제 #3
0
        public void testSetEdgeDataNull()
        {
            AdjacencyListGraph <object, string> g = new AdjacencyListGraph <object, string>();

            g.AddNode(n1);
            g.AddNode(n2);
            g.AddEdge(e1);
            g.ReplaceEdge <object, string, string>(null, "");
        }
예제 #4
0
        public void testSetEdgeDataNoDuplicate()
        {
            AdjacencyListGraph <string, string> g = graph(n1, n2);

            g.AddEdge(e1);

            g.ReplaceEdge(e1, "new");
            Assert.IsFalse(g.ContainsEdge(e1));
            Assert.IsTrue(g.ContainsEdge(new Edge <string, string>(e1.Source, e1.Destination, "new")));
        }
예제 #5
0
        public void testSetEdgeDataNoEdge()
        {
            AdjacencyListGraph <string, string> g = graph();

            g.ReplaceEdge(e1, "new_data");
        }