Пример #1
0
        public void should_park_car_correctly()
        {
            var car        = new Car();
            var parkingLot = new ParkingLot();

            smartParkingBoy.Manage(parkingLot);
            var token = smartParkingBoy.Park(car);

            Assert.Same(car, parkingLot.Pick(token));
        }
Пример #2
0
 public void should_able_to_let_his_parking_boy_to_pick_car()
 {
     var parkingBoy = new ParkingBoy();
     var parkingLot = new ParkingLot();
     parkingBoy.Manage(parkingLot);
     parkingManager.Manage(parkingBoy);
     var car = new Car();
     var token = parkingBoy.Park(car);
     Assert.Same(car, parkingManager.Pick(token));
 }
Пример #3
0
        public void should_able_to_let_his_parking_boy_to_pick_car()
        {
            var parkingBoy = new ParkingBoy();
            var parkingLot = new ParkingLot();

            parkingBoy.Manage(parkingLot);
            parkingManager.Manage(parkingBoy);
            var car   = new Car();
            var token = parkingBoy.Park(car);

            Assert.Same(car, parkingManager.Pick(token));
        }
Пример #4
0
        public void should_able_to_let_his_parking_boy_who_has_availible_parking_lot_to_park_cars()
        {
            var parkingBoy = new ParkingBoy();
            var smartParkingBoy = ParkingBoy.SmartEvolution();
            parkingBoy.Manage(new ParkingLot(1));
            smartParkingBoy.Manage(new ParkingLot(1));

            parkingManager.Manage(parkingBoy, smartParkingBoy);

            var car = new Car();
            parkingBoy.Park(new Car());
            var tokenOfParkingBoy = parkingManager.Park(car);
            Assert.Same(car, smartParkingBoy.Pick(tokenOfParkingBoy));
        }
Пример #5
0
        public void should_able_to_let_his_parking_boy_who_has_availible_parking_lot_to_park_cars()
        {
            var parkingBoy      = new ParkingBoy();
            var smartParkingBoy = ParkingBoy.SmartEvolution();

            parkingBoy.Manage(new ParkingLot(1));
            smartParkingBoy.Manage(new ParkingLot(1));

            parkingManager.Manage(parkingBoy, smartParkingBoy);

            var car = new Car();

            parkingBoy.Park(new Car());
            var tokenOfParkingBoy = parkingManager.Park(car);

            Assert.Same(car, smartParkingBoy.Pick(tokenOfParkingBoy));
        }
Пример #6
0
 public object Park(Car car)
 {
     return(park(car, managedParkingBoys) ?? stand.Park(car));
 }