Ejemplo n.º 1
0
  /** If there is a free room, getFreeRoom must return a room without guest. */
  @Test
  public void testGetFreeRoomFromNotFullHotel() {
    Room room = hotel.getFreeRoom();
    assertNull("A room is free", room.getGuest());

    hotel.checkIn(correctPassword, GUEST_NAME_1);
    Room freeRoom = hotel.getFreeRoom();
    assertNotNull("Another room is free", freeRoom);
    assertNotEquals("Another room is free", room, freeRoom);
  }
Ejemplo n.º 2
0
  /** If there is no free room, getFreeRoom must return null. */
  @Test
  public void testGetFreeRoomFromFullHotel() {
    hotel.checkIn(correctPassword, GUEST_NAME_1);
    hotel.checkIn(correctPassword, GUEST_NAME_2);

    Room noRoom = hotel.getFreeRoom();
    assertNull("No room available in a full hotel", noRoom);
  }