/** Test that a Comment instance can be created correctly. */ public void testConstructionOfSimpleInstance() { assertNotNull(comment); assertEquals("Title", comment.getTitle()); assertEquals("Body", comment.getBody()); assertEquals("Author", comment.getAuthor()); assertEquals("*****@*****.**", comment.getEmail()); assertEquals("http://www.google.com", comment.getWebsite()); assertEquals("http://graph.facebook.com/user/picture", comment.getAvatar()); assertEquals("127.0.0.1", comment.getIpAddress()); assertNotNull(comment.getDate()); assertEquals(comment.getDate().getTime(), comment.getId()); assertNotNull(comment.getBlogEntry()); assertEquals(State.APPROVED, comment.getState()); assertEquals("c/" + comment.getBlogEntry().getId() + "/" + comment.getId(), comment.getGuid()); }
/** Tests that a comment can be cloned. */ public void testClone() { Comment clonedComment = (Comment) comment.clone(); assertEquals(comment.getTitle(), clonedComment.getTitle()); assertEquals(comment.getBody(), clonedComment.getBody()); assertEquals(comment.getWebsite(), clonedComment.getWebsite()); assertEquals(comment.getAvatar(), clonedComment.getAvatar()); assertEquals(comment.getAuthor(), clonedComment.getAuthor()); assertEquals(comment.getIpAddress(), clonedComment.getIpAddress()); assertEquals(comment.getDate(), clonedComment.getDate()); assertEquals(comment.getId(), clonedComment.getId()); assertEquals(comment.getState(), clonedComment.getState()); assertEquals(comment.getParent(), clonedComment.getParent()); assertEquals(comment.getBlogEntry(), clonedComment.getBlogEntry()); }