Esempio n. 1
0
        public void ensure_delivery_to_each_house_in_turn_from_west_to_east_meets_provided_order()
        {
            var expected = new[] { 1, 2, 4, 3, 5, 6, 7, 8, 9, 10 };

            _streetSpecificationReader = Substitute.For <IStreetSpecificationReader>();

            _streetSpecificationReader.LoadFile().Returns(new[] {
                1, 2, 4, 3, 5, 6, 7, 8, 9, 10
            });

            GivenARoutePlanner();

            var actual = _routeplanner.GetDeliveryByEachhouseInTurnWestToEast();

            _routeplanner.TotalRoadCrossing().ShouldBe(7);
            actual.ShouldBe(expected);
        }
Esempio n. 2
0
        public void Given_a_valid_specification_when_deliver_in_order_then_delivery_order_should_match_order_provided()
        {
            GivenADefaultTownPlanner();

            var expectedNorthSideHouses = new List <int> {
                1, 2, 4, 3, 5
            };

            var deliveryOrder = _routePlanner.GetDeliveryByEachhouseInTurnWestToEast();

            deliveryOrder.ShouldBe(expectedNorthSideHouses);
            _routePlanner.TotalRoadCrossing().ShouldBe(2);
        }
Esempio n. 3
0
 private static void DisplayApproachTwoReport(RoutePlanner routeplanner)
 {
     System.Console.WriteLine();
     System.Console.WriteLine("Appraoch two delivery order: {0}", string.Join(", ", routeplanner.GetDeliveryByEachhouseInTurnWestToEast()));
     System.Console.WriteLine("Appraoch two total road crossings: {0}", routeplanner.TotalRoadCrossing());
 }