@Test public void addPostMessage() { String s = "new test post"; String outMes = "Message added\n"; String res = tester.newPost(s); assertEquals(res, outMes); }
@Test public void getProductByID() { Product p = tester.getProductById("2"); int id = p.getId(); assertEquals(id, 2); }
@Test public void addProductPostMethod() { String res = tester.addP(product); String outMes = product.getName() + " was added"; assertEquals(outMes, res); }
@Test public void addProduct() { tester.addProduct(product); int countProduct = tester.getCount(); assertEquals(4, countProduct); }