public void testDelete() {
    // create items
    final List<Integer> items = TestCaseDaoHelper.fixCreateItems(mItemDAO, 1);
    mItemDAO.deleteItemById(items.get(0));

    assertNull("Object exists, but it not suppose to", mItemDAO.findItem(items.get(0)));
  }
  /** Tested. */
  public void testFindItem() {
    // create 10 items
    final String title = "my-title";
    TestCaseDaoHelper.fixCreateItems(mItemDAO, title, 10);
    final Item query = new Item.Builder().title(title).build();
    final List<Item> items = mItemDAO.findItems(query, 0, 10);

    assertNotNull("Object is not empty query - " + query, items);
    assertTrue("10 Items retrieved", items.size() == 10);
    LOG.debug("items - " + items);
  }
  public void testUpdate() {
    // create items
    final List<Integer> items = TestCaseDaoHelper.fixCreateItems(mItemDAO, 1);
    final Item item = mItemDAO.findItem(items.get(0));
    LOG.debug("Old item title - " + item.getTitle());
    item.setTitle(DOCUMENT_NEW_TITLE);

    // update item object
    mItemDAO.updateItem(item);
    assertNotNull("Object has been changed.", item);
    assertEquals("Newly assigned Object tite doesn't match.", item.getTitle(), DOCUMENT_NEW_TITLE);
  }
  public void testItemCount() {
    final String itemTitle = "new titlte";
    final int itemCount = 10;
    TestCaseDaoHelper.fixCreateItems(mItemDAO, itemTitle, itemCount);

    // create items
    int numItems = mItemDAO.countItems(new Item.Builder().title(itemTitle).build());

    // verify
    assertTrue(
        "Total number of item doesn't match with our approximate number", numItems == itemCount);
  }
 @Override
 protected void tearDown() throws Exception {
   if (!mDontCleanup) {
     TestCaseDaoHelper.deleteAllItems(mItemDAO);
   }
 }