public void LeadsOutOf(string pathDescription, string edgeDescription, bool expected) { var path = GraphFactory.CreatePath(pathDescription.Select(c => c.ToString()).ToArray()); var edge = GraphFactory.CreateEdge(edgeDescription); edge.LeadsOutOf(path).Should().Be(expected); }
private IEnumerable <Path> CreatePaths() { return(new[] { GraphFactory.CreatePath("S", "1", "3", "4", "5"), // p0 GraphFactory.CreatePath("3", "4", "1", "2", "T"), // p1 GraphFactory.CreatePath("5", "4", "1", "2", "T"), // p2 GraphFactory.CreatePath("1", "3", "4", "1"), // p3 GraphFactory.CreatePath("S", "1", "2", "T"), // p4 GraphFactory.CreatePath("3", "4", "1", "3"), // p5 GraphFactory.CreatePath("5", "4", "1", "3"), // p6 GraphFactory.CreatePath("4", "1", "3", "4"), // p7 GraphFactory.CreatePath("5", "4", "5"), // p8 GraphFactory.CreatePath("4", "5", "4") // p9 }); }
public void ExampleFromIntroToSoftwareTesting() { var graph = GraphFactory.BuildGraph( "0-1", "0-4", "1-2", "1-5", "2-3", "3-1", "4-4", "4-6", "5-6"); var sut = new PrimePathFinder(); var primePaths = sut.FindPrimePaths(graph); primePaths.Should() .BeEquivalentTo( GraphFactory.CreatePath("4", "4"), GraphFactory.CreatePath("0", "4", "6"), GraphFactory.CreatePath("0", "1", "2", "3"), GraphFactory.CreatePath("0", "1", "5", "6"), GraphFactory.CreatePath("1", "2", "3", "1"), GraphFactory.CreatePath("2", "3", "1", "2"), GraphFactory.CreatePath("3", "1", "2", "3"), GraphFactory.CreatePath("2", "3", "1", "5", "6") ); }
private Path CreatePath(string sequence) { return(GraphFactory.CreatePath(sequence.Select(letter => letter.ToString()).ToArray())); }