MCPcopy Index your code
hub / github.com/castello/spring_basic / deleteTest

Method deleteTest

ch4/BoardDaoImplTest.java:50–73  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48 }
49
50 @Test
51 public void deleteTest() throws Exception {
52 boardDao.deleteAll();
53 assertTrue(boardDao.count()==0);
54
55 BoardDto boardDto = new BoardDto("no title", "no content", "asdf");
56 assertTrue(boardDao.insert(boardDto)==1);
57 Integer bno = boardDao.selectAll().get(0).getBno();
58 assertTrue(boardDao.delete(bno, boardDto.getWriter())==1);
59 assertTrue(boardDao.count()==0);
60
61 assertTrue(boardDao.insert(boardDto)==1);
62 bno = boardDao.selectAll().get(0).getBno();
63 assertTrue(boardDao.delete(bno, boardDto.getWriter()+"222")==0);
64 assertTrue(boardDao.count()==1);
65
66 assertTrue(boardDao.delete(bno, boardDto.getWriter())==1);
67 assertTrue(boardDao.count()==0);
68
69 assertTrue(boardDao.insert(boardDto)==1);
70 bno = boardDao.selectAll().get(0).getBno();
71 assertTrue(boardDao.delete(bno+1, boardDto.getWriter())==0);
72 assertTrue(boardDao.count()==1);
73 }
74
75 @Test
76 public void insertTest() throws Exception {

Callers

nothing calls this directly

Calls 7

getWriterMethod · 0.95
deleteAllMethod · 0.65
countMethod · 0.65
insertMethod · 0.65
selectAllMethod · 0.65
deleteMethod · 0.65
getBnoMethod · 0.45

Tested by

no test coverage detected