Пример #1
0
 @Test
 public void testCreate() throws Exception {
   Bill bill = new Bill(1, true, 50);
   Bill newBill = dao.create(bill);
   assertTrue(newBill.getOrderId() == bill.getOrderId());
   dao.delete(newBill.getId());
 }
Пример #2
0
  @Test
  public void testDelete() throws Exception {
    Bill bill = new Bill(1, true, 50);

    Collection<Bill> test1 = dao.get();
    Bill newBill = dao.create(bill);
    Collection<Bill> test2 = dao.get();
    dao.delete(newBill.getId());
    Collection<Bill> test3 = dao.get();

    assertTrue(test1.size() == test3.size());
    assertTrue(test1.size() + 1 == test2.size());
  }