Exemple #1
0
        void should_pick_car_using_valid_ticket_when_parking_boy_pick_a_car()
        {
            var parkingBoy  = new ParkingBoy();
            var validTicket = new Ticket("lisence");
            var car         = parkingBoy.Take(validTicket);

            Assert.NotNull(car);
        }
Exemple #2
0
        void should_not_parking_boy_take_the_car_give_user_parking_car_when_parking_boy_take_car_with_no_ticket()
        {
            var car        = new Car("lisence");
            var parkingLot = new ParkingLot(true);
            var parkingBoy = new ParkingBoy(new List <ParkingLot>
            {
                parkingLot
            });

            Assert.Throw(UnavailableTicketException)(() => parkingBoy.Take());
        }
Exemple #3
0
        void should_not_parking_boy_take_the_car_given_parking_boy_work_in_parking_lot_when_user_take_car_with_invalid_ticket()
        {
            var car           = new Car("lisence not exist");
            var invalidTicket = new Ticket(car.Lisence);
            var parkingLot    = new ParkingLot(true);
            var parkingBoy    = new ParkingBoy(new List <ParkingLot>
            {
                parkingLot
            });

            Assert.Throw <UnavailableTicketException>(() => parkingBoy.Take(invalidTicket))
        }
Exemple #4
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);
        }