コード例 #1
0
        public void FindCheapestPath_FindsTheProperPath_ForDirectedGraphs([NotNull] string relationships, char from,
                                                                          char to, string expected)
        {
            var graph  = new LiteralGraph(relationships, true);
            var actual = string.Join(",", graph.FindCheapestPath(from, to));

            Assert.AreEqual(expected, actual);
        }
コード例 #2
0
        public void FindCheapestPath_ThrowsException_IfFromVertexIsInvalid()
        {
            var graph = new LiteralGraph("A-1-B", false);

            Assert.Throws <ArgumentException>(() => graph.FindCheapestPath('Z', 'A'));
        }