Beispiel #1
0
        public void given_a_parking_lot_when_parking_two_car_then_I_can_pick_all_of_them()
        {
            var parkingLot = new OOParkingLot(2);
            var firstCar   = new Car("Car One");
            var secondCar  = new Car("Second One");

            parkingLot.Park(firstCar);
            var secondCarId = parkingLot.Park(secondCar);

            Assert.AreSame(secondCar, parkingLot.Pick(secondCarId));
        }
Beispiel #2
0
        given_a_parking_lot_and_parking_boy_when_parking_boy_park_a_car_then_pick_the_car_from_parking_lot
            ()
        {
            var parkingLot = new OOParkingLot(1);
            var parkingBoy = new ParkingBoy(parkingLot);

            var myCar = new Car("a");
            var carId = parkingBoy.Park(myCar);

            Assert.AreSame(myCar, parkingLot.Pick(carId));
        }
Beispiel #3
0
        given_two_parking_lot_with_first_parking_lot_is_full_when_parking_boy_park_a_car_then_the_car_parked_in_the_second_parking_lot
            ()
        {
            var firstParkingLot  = new OOParkingLot(0);
            var secondParkingLot = new OOParkingLot(1);
            var parkingBoy       = new ParkingBoy(firstParkingLot, secondParkingLot);
            var car = new Car("car");

            var carId = parkingBoy.Park(car);

            Assert.AreSame(car, secondParkingLot.Pick(carId));
        }
        public void given_first_parkingLot_with_two_space_and_second_parkingLot_with_one_space_and_a_smart_parking_boy_when_smart_boy_park_a_car_then_the_car_in_the_first_parkingLot()
        {
            var firstParkinglot  = new OOParkingLot(2);
            var secondParkinglot = new OOParkingLot(2);
            var parkedCar        = new Car("parked car");

            secondParkinglot.Park(parkedCar);

            var smartParkingBoy = new SmartParkingBoy(firstParkinglot, secondParkinglot);
            var car             = new Car("car");
            var carId           = smartParkingBoy.Park(car);

            Assert.AreSame(car, firstParkinglot.Pick(carId));
        }
        public void given_two_parkinglot_and_the_first_parkinglot_emptyRate_is_smaller_than_the_second_one_when_super_boy_park_a_car_then_the_second_parkinglot_could_pick_the_car()
        {
            var firstPrakingLot  = new OOParkingLot(3);
            var secondPrakingLot = new OOParkingLot(4);
            var car = new Car("car");
            var parkedCarInFirstParkingLot  = new Car("car parked in the first parkinglot");
            var parkedCarInSecondParkingLot = new Car("car parked in the second parkinglot");

            firstPrakingLot.Park(parkedCarInFirstParkingLot);
            secondPrakingLot.Park(parkedCarInSecondParkingLot);
            var superBoy = new SuperParkingBoy(firstPrakingLot, secondPrakingLot);

            var carId = superBoy.Park(car);

            Assert.AreSame(car, secondPrakingLot.Pick(carId));
        }