コード例 #1
0
        public void manager_should_park_and_pick()
        {
            var car = new Car();
            var manager = new ParkingBoyManager(new List<IParkable> { new ParkingLot(1)});

            Assert.Same(car, manager.Pick(manager.Park(car)));
        }
コード例 #2
0
        public void should_ask_super_boy_to_park()
        {
            var car = new Car();
            var manager = new ParkingBoyManager(
                new List<IParkable> { new SuperParkingBoy(new ParkingLot()) });

            Assert.Same(car, manager.Pick(manager.Park(car)));
        }
コード例 #3
0
        public void should_try_to_park_in_available_parkingLot()
        {
            var car = new Car();
            var superParkingBoy = new SuperParkingBoy(new ParkingLot(1));
            superParkingBoy.Park(new Car());
            var manager = new ParkingBoyManager(
                new List<IParkable>
                {
                    superParkingBoy, new SmartParkingBoy(new ParkingLot(10))
                });

            Assert.Same(car, manager.Pick(manager.Park(car)));
        }