protected override void Given()
 {
     var graph = GraphMother.ChannelDelanceyThornlandsBeckwith;
     nav = new GraphNavigator(graph,
         PointMother.ChannelSt, PointMother.ChannelSt,
         new ChannelDelanceyBeckwithThornlandsRoadService());
     cycles = nav.GetCycles();
     //foreach (var c in cycles) { Console.WriteLine(c.ToString()); }
     stitcher = new StitchingService(cycles, graph);
 }
        public Directions Optimize(Point[] points)
        {
            DBC.Assert(points.Length > 1, "Unable to optimize a route with less than 2 points.");

            Log(points);

            if (IsSingleRouteDirections(points)) return BuildSingleRouteDirections(points);

            var graph = new DirectedGraph(points);
            var graphNavigator = new GraphNavigator(graph, points.First(), points.Last(), roadPathService);
            IList<Directions> cycles = graphNavigator.GetCycles();
            stitchingService = new StitchingService(cycles, graph);
            var stitched = stitchingService.Stitch();
            stitched.Order(points.First(), points.Last());
            return stitched;
        }
 protected override void Given()
 {
     var graph = GraphMother.ChannelDelanceyThornlandsBeckwith;
     nav = new GraphNavigator(graph,
         PointMother.ChannelSt, PointMother.ChannelSt,
         new ChannelDelanceyBeckwithThornlandsRoadService());
     stitcher = new StitchingService(nav.GetCycles(), graph);
 }