Пример #1
0
        public void should_not_pick_car_when_the_car_is_not_in_parking_lot()
        {
            var parkingBoy = new ParkingBoy(new ParkingLot(1));
            var token      = Guid.NewGuid().ToString();

            parkingBoy.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 parkingBoy = new ParkingBoy(parkingLot);

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