private static void AssertSameProperties <TVertex, TEdge>(IUndirectedGraph <TVertex, TEdge> graph) where TEdge : IEdge <TVertex> { ArrayUndirectedGraph <TVertex, TEdge> undirectedGraph = graph.ToArrayUndirectedGraph(); Assert.AreEqual(graph.VertexCount, undirectedGraph.VertexCount); CollectionAssert.AreEqual(graph.Vertices, undirectedGraph.Vertices); Assert.AreEqual(graph.EdgeCount, undirectedGraph.EdgeCount); CollectionAssert.AreEqual(graph.Edges, undirectedGraph.Edges); foreach (TVertex vertex in graph.Vertices) { CollectionAssert.AreEqual(graph.AdjacentEdges(vertex), undirectedGraph.AdjacentEdges(vertex)); } }