public void TopologicalSort_AlignsTheVerticesAsExpected([NotNull] string relationships, string expected) { var graph = new LiteralGraph(relationships, true); var result = graph.TopologicalSort().ToList(); var actual = string.Join(",", result); Assert.AreEqual(expected, actual); }
public void TopologicalSort_ThrowsException_ForUndirectedGraph() { var graph = new LiteralGraph("A-1-B", false); Assert.Throws <InvalidOperationException>(() => graph.TopologicalSort()); }
public void TopologicalSort_ThrowsException_ForDirectedGraphWith([NotNull] string relationships) { var graph = new LiteralGraph(relationships, true); Assert.Throws <InvalidOperationException>(() => graph.TopologicalSort()); }