public void GenBFSTreeFromCubeFaces() { using (Solid testcube = UnfoldTestUtils.SetupCube()) { List <Face> faces = testcube.Faces.ToList(); var graph = ModelTopology.GenerateTopologyFromFaces(faces); List <Object> face_objs = faces.Select(x => x as Object).ToList(); UnfoldTestUtils.GraphHasVertForEachFace(graph, face_objs); UnfoldTestUtils.GraphHasCorrectNumberOfEdges(24, graph); var nodereturn = ModelGraph.BFS <EdgeLikeEntity, FaceLikeEntity>(graph); object tree = nodereturn; var casttree = tree as List <GraphVertex <EdgeLikeEntity, FaceLikeEntity> >; UnfoldTestUtils.GraphHasVertForEachFace(casttree, face_objs); UnfoldTestUtils.GraphHasCorrectNumberOfTreeEdges(5, casttree); UnfoldTestUtils.AssertAllFinishingTimesSet(graph); var sccs = GraphUtilities.TarjansAlgo <EdgeLikeEntity, FaceLikeEntity> .CycleDetect(casttree, GraphUtilities.EdgeType.Tree); UnfoldTestUtils.IsAcylic <EdgeLikeEntity, FaceLikeEntity>(sccs, casttree); foreach (IDisposable item in graph) { Console.WriteLine("disposing a graphnode"); item.Dispose(); } foreach (IDisposable item in faces) { Console.WriteLine("disposing a face"); item.Dispose(); } foreach (IDisposable item in casttree) { Console.WriteLine("disposing a face"); item.Dispose(); } } }