예제 #1
0
  @Test
  public void deleteItem_should_return_minus_one_if_unsuccessful() {
    Item item = new Item(1);
    String json = jsonHandler.itemToJSON(item);
    dbHandler.setDeleteResult(false);
    initProvider();
    int result = provider.deleteItem(json);

    assertEquals(-1, result);
  }
예제 #2
0
  @Test
  public void deleteItem_should_return_the_id_if_successful() {
    Item item = new Item(1);
    String json = jsonHandler.itemToJSON(item);
    dbHandler.setDeleteResult(true);
    initProvider();
    int result = provider.deleteItem(json);

    assertEquals(item.getItemno(), result);
  }