示例#1
0
        public void should_park_the_car_to_the_parking_lot_with_highest_vacancy_rate_and_no_relationship_with_the_parking_lot_order()
        {
            var parkingLotWithLowVacancyRate = new ParkingLot(4);

            parkingLotWithLowVacancyRate.Park(new Car());
            var parkingLotWithHighVacancyRate = new ParkingLot(2);
            var parkingBoy = ParkingBoy.Super(parkingLotWithLowVacancyRate, parkingLotWithHighVacancyRate);
            var car        = new Car();

            var ticket = parkingBoy.Park(car);

            Assert.Same(car, parkingLotWithHighVacancyRate.Pick(ticket));
        }
示例#2
0
        public void should_be_able_to_pick_the_same_car_from_the_second_parking_lot_when_super_parking_boy_has_two_parking_lot_with_first_one_full_and_park_the_car()
        {
            var parkingLot1 = new ParkingLot(1);

            parkingLot1.Park(new Car());
            var parkingLot2 = new ParkingLot(1);
            var parkingBoy  = ParkingBoy.Super(parkingLot1, parkingLot2);
            var car         = new Car();

            var ticket = parkingBoy.Park(car);

            Assert.Same(car, parkingLot2.Pick(ticket));
        }