public void DistanceBetweenTwoEdges_DelanceyBeckwith_ChannelThornlands()
        {
            var graph = new DirectedGraph(new[]
                                      {
                                          PointMother.DelanceySt, PointMother.ThornlandsRd, PointMother.BeckwithSt,
                                          PointMother.ChannelSt
                                      });
            var delanceyBeckwith = graph.GetEdge(new[] {PointMother.DelanceySt, PointMother.BeckwithSt});
            var channelThornlands = graph.GetEdge(new[] {PointMother.ChannelSt, PointMother.ThornlandsRd});

            var result = graph.DistanceBetweenTwoEdges(delanceyBeckwith, channelThornlands);
            Assert.AreEqual(4.0, result, 0.1);
        }
Ejemplo n.º 2
0
 public IEnumerable<Edge> Edges(DirectedGraph graph)
 {
     return Routes.Select(r =>
         {
             return (r.From.Equals(r.To))
                 ? new Edge(new[] { r.From, r.To }, 0, 0)
                 : graph.GetEdge(r);
         });
 }