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

Method increaseViewCntTest

ch4/BoardDaoImplTest.java:175–195  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

173 }
174
175 @Test
176 public void increaseViewCntTest() throws Exception {
177 boardDao.deleteAll();
178 assertTrue(boardDao.count()==0);
179
180 BoardDto boardDto = new BoardDto("no title", "no content", "asdf");
181 assertTrue(boardDao.insert(boardDto)==1);
182 assertTrue(boardDao.count()==1);
183
184 Integer bno = boardDao.selectAll().get(0).getBno();
185 assertTrue(boardDao.increaseViewCnt(bno)==1);
186
187 boardDto = boardDao.select(bno);
188 assertTrue(boardDto!=null);
189 assertTrue(boardDto.getView_cnt() == 1);
190
191 assertTrue(boardDao.increaseViewCnt(bno)==1);
192 boardDto = boardDao.select(bno);
193 assertTrue(boardDto!=null);
194 assertTrue(boardDto.getView_cnt() == 2);
195 }
196}

Callers

nothing calls this directly

Calls 8

getView_cntMethod · 0.95
deleteAllMethod · 0.65
countMethod · 0.65
insertMethod · 0.65
selectAllMethod · 0.65
increaseViewCntMethod · 0.65
selectMethod · 0.65
getBnoMethod · 0.45

Tested by

no test coverage detected