コード例 #1
0
  @Test
  public void testRemove() {
    int oldSize = questionDao.list().size();
    Question question = questionDao.find(1);
    questionDao.delete(question);
    int newSize = questionDao.list().size();

    assertFalse(oldSize != newSize);
  }
コード例 #2
0
  @Test
  public void testAdd() {
    int oldSize = questionDao.list().size();
    Question question = new Question("Are you OK?", 2);
    questionDao.add(question);
    int newSize = questionDao.list().size();

    assertFalse(oldSize == newSize);
  }
コード例 #3
0
 @Test
 public void testList() {
   List<Question> list = questionDao.list();
   assertNotNull(list);
   assertFalse(list.isEmpty());
 }