| 47 | } |
| 48 | |
| 49 | @Test |
| 50 | public void write() throws Exception { |
| 51 | boardDao.deleteAll(); |
| 52 | |
| 53 | BoardDto boardDto = new BoardDto("hello", "hello", "asdf"); |
| 54 | assertTrue(boardDao.insert(boardDto) == 1); |
| 55 | Integer bno = boardDao.selectAll().get(0).getBno(); |
| 56 | System.out.println("bno = " + bno); |
| 57 | |
| 58 | commentDao.deleteAll(bno); |
| 59 | CommentDto commentDto = new CommentDto(bno,0,"hi","qwer"); |
| 60 | |
| 61 | assertTrue(boardDao.select(bno).getComment_cnt() == 0); |
| 62 | assertTrue(commentService.write(commentDto)==1); |
| 63 | |
| 64 | Integer cno = commentDao.selectAll(bno).get(0).getCno(); |
| 65 | assertTrue(boardDao.select(bno).getComment_cnt() == 1); |
| 66 | } |
| 67 | } |