@Test
 public void testAddItemDuplicate() {
   Menu m = new Menu(name, description);
   assertTrue(m.addItem(i1));
   assertFalse(m.addItem(i1));
   assertTrue(m.addItem(i2));
 }
 @Test
 public void testSetSpecial() {
   Menu m = new Menu(name, description);
   assertTrue(m.addItem(i1));
   assertTrue(m.setSpecial(i1));
   assertTrue(m.getSpecial().equals(i1));
 }
예제 #3
0
  @Test
  public void testSetGetEvent() {

    Menu testMenu = new Menu(67890);
    testMenu.setEvent("Easter Dinner");

    assertEquals("Easter Dinner", testMenu.getEvent());
  }
예제 #4
0
  @Test
  public void testSetGetName() {

    Menu testMenu = new Menu(12345);
    testMenu.setName("Denny's Menu");

    assertEquals("Denny's Menu", testMenu.getName());
  }
  @Test
  public void testRemoveItem() {
    Menu m = new Menu(name, description);
    assertTrue(m.addItem(i1));
    assertTrue(m.addItem(i2));

    assertTrue(m.removeItem(i1));
    assertTrue(m.removeItem(i2));
  }
  @Test
  public void testEquals() {
    Menu m1 = new Menu(name, description);
    assertTrue(m1.addItem(i1));
    assertTrue(m1.addItem(i2));

    Menu m2 = new Menu(name, description);
    assertTrue(m2.addItem(i1));
    assertTrue(m2.addItem(i2));

    assertTrue(m1.equals(m2));
  }
 @Test
 public void testSetSpecialNoItems() {
   Menu m = new Menu(name, description);
   assertFalse(m.setSpecial(i2));
 }