()
| 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 | } |
nothing calls this directly
no test coverage detected