use of com.instructure.canvasapi2.models.DiscussionEntry in project instructure-android by instructure.
the class DiscussionEntryHTMLConverterTest method getReadState_read.
@Test
public void getReadState_read() throws Exception {
DiscussionEntryHtmlConverter converter = new DiscussionEntryHtmlConverter();
DiscussionEntry discussionEntry = new DiscussionEntry();
discussionEntry.setUnread(false);
String testValue = converter.getReadState(discussionEntry);
assertEquals("read", testValue);
}
use of com.instructure.canvasapi2.models.DiscussionEntry in project instructure-android by instructure.
the class DiscussionEntryTest method addInnerReplyTest.
@Test
public void addInnerReplyTest() throws Exception {
DiscussionEntry entry = new DiscussionEntry();
entry.setId(1L);
DiscussionEntry reply = new DiscussionEntry();
entry.addReply(reply);
DiscussionEntry innerReply = new DiscussionEntry();
entry.addInnerReply(reply, innerReply);
assertEquals(1, entry.getReplies().get(0).getReplies().size());
}
use of com.instructure.canvasapi2.models.DiscussionEntry in project instructure-android by instructure.
the class DiscussionEntryTest method depthTest_Zero.
@Test
public void depthTest_Zero() throws Exception {
DiscussionEntry entry = new DiscussionEntry();
assertEquals(0, entry.getDepth());
}
use of com.instructure.canvasapi2.models.DiscussionEntry in project instructure-android by instructure.
the class DiscussionEntryTest method initTest_Unread.
@Test
public void initTest_Unread() throws Exception {
DiscussionTopic topic = new DiscussionTopic();
DiscussionEntry parent = new DiscussionEntry();
DiscussionEntry entry = new DiscussionEntry();
entry.init(topic, parent);
assertEquals(0, entry.getUnreadChildren());
}
use of com.instructure.canvasapi2.models.DiscussionEntry in project instructure-android by instructure.
the class DiscussionTopicHeaderTest method convertToDiscussionEntryTest_Message.
@Test
public void convertToDiscussionEntryTest_Message() throws Exception {
String message = "here is a message";
DiscussionTopicHeader header = new DiscussionTopicHeader();
header.setMessage(message);
DiscussionEntry entry = header.convertToDiscussionEntry("graded", "points");
assertEquals(header.getMessage(), entry.getMessage());
}
Aggregations