Exemplo n.º 1
0
        public bool AddVerticesAndEdge <TVertex, TEdge>([PexAssumeUnderTest] AdjacencyGraph <TVertex, TEdge> target, TEdge e)
            where TEdge : IEdge <TVertex>
        {
            // TODO: add assertions to method AdjacencyGraphTVertexTEdgeTest.AddVerticesAndEdge(AdjacencyGraph`2<!!0,!!1>, !!1)
            bool result = target.AddVerticesAndEdge(e);

            return(result);
        }
        public static AdjacencyGraph <int, Edge <int> > Create(
            bool allowParralelEdges,
            KeyValuePair <int, int>[] edges)
        {
            Assert.NotNull(edges);

            var adjacencyGraph
                = new AdjacencyGraph <int, Edge <int> >(allowParralelEdges);

            if (edges != null && edges.Length <= 3)
            {
                foreach (var edge in edges)
                {
                    adjacencyGraph.AddVerticesAndEdge(new Edge <int>(edge.Key, edge.Value));
                }
            }

            return(adjacencyGraph);
        }