예제 #1
0
 @Test
 public void testGetItems() {
   ItemRepository testRepository = new ItemRepository();
   testRepository.addItem(item1);
   Item temp = (Item) testRepository.getItems(item1.getName()).toArray()[0];
   assertEquals("Wrong item returned", item1.getName(), temp.getName());
 }
예제 #2
0
 // AddItem
 @Test
 public void testAddItem() {
   ItemRepository testRepository = new ItemRepository();
   testRepository.addItem(item1);
   Item temp = (Item) testRepository.getItems(item1.getName()).toArray()[0];
   assertTrue("ERROR in addItem: addItem not performed", temp.equals(item1));
 }