예제 #1
0
        public void should_able_to_park_a_car_after_pick_a_car()
        {
            var fullParkingLot = new ParkingLot(1);
            fullParkingLot.Pick(fullParkingLot.Park(new Car()));

            Assert.NotNull(fullParkingLot.Park(new Car()));
        }
예제 #2
0
        public void should_return_null_if_try_park_to_full_parkinglot()
        {
            var fullParkingLot = new ParkingLot(1);
            fullParkingLot.Park(new Car());

            Assert.Null(fullParkingLot.Park(new Car()));
        }
예제 #3
0
        public void should_pick_car_after_park_car_as_a_parking_lot()
        {
            var car   = new Car();
            var token = parkingLot.Park(car);

            Assert.Same(car, parkingLot.Pick(token));
        }
예제 #4
0
        public void should_able_to_park_a_car_after_pick_a_car()
        {
            var fullParkingLot = new ParkingLot(1);

            fullParkingLot.Pick(fullParkingLot.Park(new Car()));

            Assert.NotNull(fullParkingLot.Park(new Car()));
        }
예제 #5
0
        public void should_return_null_if_try_park_to_full_parkinglot()
        {
            var fullParkingLot = new ParkingLot(1);

            fullParkingLot.Park(new Car());

            Assert.Null(fullParkingLot.Park(new Car()));
        }
예제 #6
0
        public void should_able_to_pick_car_in_second_parking_lots()
        {
            var secondParkingLot = new ParkingLot();
            smartParkingBoy.Manage(new ParkingLot(), secondParkingLot);
            var car = new Car();
            var ticket = secondParkingLot.Park(car);

            Assert.Same(car, smartParkingBoy.Pick(ticket));
        }
예제 #7
0
        public void should_able_to_pick_car_in_second_parking_lots()
        {
            var secondParkingLot = new ParkingLot();

            parkingManager.Manage(new ParkingLot(), secondParkingLot);
            var car    = new Car();
            var ticket = secondParkingLot.Park(car);

            Assert.Same(car, parkingManager.Pick(ticket));
        }
예제 #8
0
 public void should_park_cars_to_max_empty_rate_parkinglot()
 {
     var car = new Car();
     var parkingLot = new ParkingLot(5);
     var moreEmptyRateParkingLot = new ParkingLot(3);
     parkingLot.Park(new Car());
     superParkingBoy.Manage(parkingLot, moreEmptyRateParkingLot);
     var token = superParkingBoy.Park(car);
     Assert.Same(car, moreEmptyRateParkingLot.Pick(token));
 }
예제 #9
0
        public void should_park_cars_to_max_empty_rate_parkinglot()
        {
            var car        = new Car();
            var parkingLot = new ParkingLot(5);
            var moreEmptyRateParkingLot = new ParkingLot(3);

            parkingLot.Park(new Car());
            superParkingBoy.Manage(parkingLot, moreEmptyRateParkingLot);
            var token = superParkingBoy.Park(car);

            Assert.Same(car, moreEmptyRateParkingLot.Pick(token));
        }