@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()); }
// 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)); }