@Test public void testUpdate() { long id = catalogue.getByName("banana").get(0).getId(); // Product newProd = new Product(id, "bolof", 123); // catalogue.update(newProd); Assert.assertFalse(catalogue.find(id).getName().equals("banana")); }
@Test public void testGetAll() { Assert.assertTrue(catalogue.getAll("Product").size() == 2); }
@Test public void testAdd() { Assert.assertTrue(catalogue.getCount("Product") == 2); }
@Test public void testRemove() { catalogue.remove(catalogue.getByName("banana").get(0).getId()); Assert.assertTrue(catalogue.getCount("Product") == 1); }
@Before public void setup() { catalogue.clear("Product"); // catalogue.add(new Product("banana", 13.11)); wrong constructors // catalogue.add(new Product("sven", 10.11)); }