示例#1
0
 public void ShouldCalcuteTheCostOfASimpleRouteFrom_CityTo_City(string routeDescription, int expectedDistance)
 {
     var railroad = GivenA.RailRoadWithMultipleTracks();
     var route = Route.Parse(routeDescription);
     int distance = new DistanceEvaluator().MeasureTheDistance(railroad, route);
     distance.Should().Be(expectedDistance);
 }
示例#2
0
 public RailRoadService(RailRoadFactory railRoadFactory, RailRoadIOService railRoadIoService, DistanceEvaluator distanceEvaluator, LimitedStopsRouteFinder limitedStopsRouteFinder, ExactNumberStopsRouteFinder exactNumberStopsRouteFinder, DistanceOfShortestRouteFinder shortestRoutesFinder, NumberOfRoutesWithDistanceLimitFinder numberOfRoutesWithDistanceLimitFinder)
 {
     this.railRoadFactory = railRoadFactory;
     this.railRoadIoService = railRoadIoService;
     this.distanceEvaluator = distanceEvaluator;
     this.limitedStopsRouteFinder = limitedStopsRouteFinder;
     this.exactNumberStopsRouteFinder = exactNumberStopsRouteFinder;
     this.shortestRoutesFinder = shortestRoutesFinder;
     this.numberOfRoutesWithDistanceLimitFinder = numberOfRoutesWithDistanceLimitFinder;
 }
示例#3
0
 public void ShouldCalculateTheDistanceOfRoutesWithMultipleCities(string routeDescription, int expectedDistance)
 {
     var railroad = GivenA.RailRoadWithMultipleTracks();
     int distance = new DistanceEvaluator().MeasureTheDistance(railroad, Route.Parse(routeDescription));
     distance.Should().Be(expectedDistance);
 }