示例#1
0
        void should_parking_get_the_car_given_user_parked_car_When_parking_pick_the_car_with_valid_ticket()
        {
            var car             = new Car("lisence");
            var parkingLot      = new ParkingLot(true);
            var availableTicket = parkingLot.Park(car);
            var parkingBoy      = new ParkingBoy(new List <ParkingLot>
            {
                parkingLot
            });
            var returnedCar = parkingBoy.Take(availableTicket);

            Assert.NotNull(returnedCar);
            Assert.Equal(car.Lisence, returnedCar.Lisence);
        }
示例#2
0
        void should_park_car_in_B_given_parking_boy_is_in_parking_lot_A_and_parking_lot_B_B_is_available_when_he_park_car()
        {
            var car         = new Car("lisence");
            var parkingLotA = new ParkingLot(false);
            var parkingLotB = new ParkingLot(true);
            var parkingBoy  = new ParkingBoy(new List <ParkingLot>
            {
                parkingLotA,
                parkingLotB
            });
            var ticket = parkingBoy.Park(car);

            Assert.NotNull(ticket);
            Assert.True(parkingLotB.hasCar(car));
            Assert.False(parkingLotA.hasCar(car));
        }