Пример #1
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;
 }
 public void ShouldReturnZeroRoutesIfTheOriginIsALeaf()
 {
     var railroad = GivenA.SimpleRailRoad();
     var routes = new LimitedStopsRouteFinder().Find(railroad, new City("C"), new City("A"), 10);
     routes.Should().Be(0);
 }
 public void ShouldGetAListOfPossibleRoutesFromCityToCityInASimpleRailRoad(string origin, string destination, int maximumStops, int possibleRoutes)
 {
     var railroad = GivenA.SimpleRailRoad();
     var routes = new LimitedStopsRouteFinder().Find(railroad, new City(origin), new City(destination), maximumStops);
     routes.Should().Be(possibleRoutes);
 }