コード例 #1
0
        public void should_not_pick_car_when_the_car_is_not_in_parking_lot()
        {
            var superParkingBoy = new SuperParkingBoy(new ParkingLot(1));
            var token           = Guid.NewGuid().ToString();

            superParkingBoy.Invoking(p => p.Pick(token))
            .ShouldThrow <CarNotFoundException>()
            .WithMessage("Cannot find the car.");
        }
コード例 #2
0
        public void should_not_park_car_when_all_managed_parking_lots_are_full()
        {
            var parkingLot = new ParkingLotBuilder()
                             .WithCapacity(1)
                             .WithOccupiedParkingSpace(1)
                             .Create();
            var superParkingBoy = new SuperParkingBoy(parkingLot);

            superParkingBoy.Invoking(p => p.Park(new Car()))
            .ShouldThrow <ParkingFailedException>()
            .WithMessage("Cannot park at this moment.");
        }