Exemplo n.º 1
0
 /** Tests that the initial QuestRoom returned is the same as the initial QuestRoom that is set. */
 @Test
 public void testSameInitialRoom() {
   QuestHouse houseOfRooms = new QuestHouse();
   houseOfRooms.setInitialRoom(mockRoom);
   assertSame(
       mockRoom, houseOfRooms.getInitialRoom()); // Asserts that the QuestRoom objects are the same
 }
Exemplo n.º 2
0
 /**
  * Tests that setting the initial room of a QuestBuilding object with a non-null QuestRoom object
  * will return a non-null QuestRoom object. This is not a particularly good test but it does show
  * that an initial room will be set to something other than null.
  */
 @Test
 public void testSetInitialRoom() {
   QuestHouse houseOfRooms = new QuestHouse();
   houseOfRooms.setInitialRoom(mockRoom);
   assertNotNull(houseOfRooms.getInitialRoom()); // Asserts that the initial room is not null
 }
Exemplo n.º 3
0
 /**
  * Tests that a new QuestBuilding object will return null if you try to get its initial QuestRoom
  * object.
  */
 @Test
 public void testEmptyInitialRoom() {
   QuestHouse houseOfRooms = new QuestHouse();
   assertNull(houseOfRooms.getInitialRoom()); // Asserts that the initial room is null
 }