Пример #1
0
        public void ShouldIdentifyIfTheTrackConnectTheGivenCities()
        {
            var origin = new City("A");
            var destination = new City("B");
            var otherCity = new City("C");

            var track = new Track(origin, destination, 4);

            track.IsAConnectionBetween(origin, destination).Should().BeTrue();
            track.IsAConnectionBetween(origin, otherCity).Should().BeFalse();
        }
 protected override bool ShouldKeepRunningInThisRoute(RouteWithDistanceFromStart runningRoute, Track track)
 {
     return !(runningRoute.DistanceFromStart >= distanceLimit);
 }
 protected override bool ShouldKeepRunningInThisRoute(RouteWithDistanceFromStart runningRoute, Track track)
 {
     return !(runningRoute.Cities.Contains(track.Destination) && !track.Destination.Equals(FinalDestination));
 }
Пример #4
0
 private bool ThisTrackWillLeadMeToDestination(Track track)
 {
     return track.Destination.Equals(FinalDestination);
 }
Пример #5
0
 protected abstract bool ShouldKeepRunningInThisRoute(RouteWithDistanceFromStart runningRoute, Track track);