Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        public void TopologicalSort_ThrowsException_ForUndirectedGraph()
        {
            var graph = new LiteralGraph("A-1-B", false);

            Assert.Throws <InvalidOperationException>(() => graph.TopologicalSort());
        }
Ejemplo n.º 3
0
        public void TopologicalSort_ThrowsException_ForDirectedGraphWith([NotNull] string relationships)
        {
            var graph = new LiteralGraph(relationships, true);

            Assert.Throws <InvalidOperationException>(() => graph.TopologicalSort());
        }