private void CheckDAG <TVertex, TEdge>(
     IVertexAndEdgeListGraph <TVertex, TEdge> g,
     IMutableBidirectionalGraph <AdjacencyGraph <TVertex, TEdge>, CondensedEdge <TVertex, TEdge, AdjacencyGraph <TVertex, TEdge> > > cg)
     where TEdge : IEdge <TVertex>
 {
     // check it's a dag
     try
     {
         cg.TopologicalSort();
     }
     catch (NonAcyclicGraphException)
     {
         Assert.False(true);
     }
 }
 private static void CheckDAG <TVertex, TEdge>(
     [NotNull] IMutableBidirectionalGraph <AdjacencyGraph <TVertex, TEdge>, CondensedEdge <TVertex, TEdge, AdjacencyGraph <TVertex, TEdge> > > condensedGraph)
     where TEdge : IEdge <TVertex>
 {
     // Check it's a dag
     try
     {
         // ReSharper disable once ReturnValueOfPureMethodIsNotUsed
         condensedGraph.TopologicalSort();
     }
     catch (NonAcyclicGraphException)
     {
         Assert.Fail("Graph is not a DAG.");
     }
 }