コード例 #1
0
  @Test
  public void should_success_to_park_car_when_two_parkinglot_both_empty() {
    ParkingBoy smartParkingBoy =
        ParkingBoy.smartParkingBoy(Arrays.asList(new ParkingLot(1), new ParkingLot(1)));

    Car car = new Car(CAR_LICENSE);
    UUID ticket = smartParkingBoy.park(car);

    assertEquals(car, smartParkingBoy.pick(ticket));
  }
コード例 #2
0
  @Test
  public void should_success_to_pick_car_when_parked_a_car_in_one_parkinglot_with_one_capacity() {
    ParkingBoy smartParkingBoy =
        ParkingBoy.smartParkingBoy(Collections.singletonList(new ParkingLot(1)));

    Car car = new Car(CAR_LICENSE);
    UUID ticket = smartParkingBoy.park(car);

    assertEquals(car, smartParkingBoy.pick(ticket));
  }