use of com.instructure.canvasapi2.models.DiscussionEntry in project instructure-android by instructure.
the class DiscussionEntryTest method initTest_UnreadChildrenOne.
@Test
public void initTest_UnreadChildrenOne() throws Exception {
long id = 7L;
ArrayList<Long> unreadEntries = new ArrayList<>();
DiscussionTopic topic = new DiscussionTopic();
DiscussionEntry parent = new DiscussionEntry();
DiscussionEntry entry = new DiscussionEntry();
DiscussionEntry reply = new DiscussionEntry();
reply.setId(id);
unreadEntries.add(id);
topic.setUnreadEntries(unreadEntries);
entry.addReply(reply);
entry.init(topic, parent);
assertEquals(1, entry.getUnreadChildren());
}
use of com.instructure.canvasapi2.models.DiscussionEntry in project instructure-android by instructure.
the class DiscussionEntryTest method addReplyTest.
@Test
public void addReplyTest() throws Exception {
DiscussionEntry entry = new DiscussionEntry();
entry.addReply(null);
assertNotNull(entry.getReplies());
}
use of com.instructure.canvasapi2.models.DiscussionEntry in project instructure-android by instructure.
the class DiscussionEntryTest method initTest_TotalChildrenZero.
@Test
public void initTest_TotalChildrenZero() throws Exception {
DiscussionTopic topic = new DiscussionTopic();
DiscussionEntry parent = new DiscussionEntry();
DiscussionEntry entry = new DiscussionEntry();
entry.init(topic, parent);
assertEquals(0, entry.getTotalChildren());
}
use of com.instructure.canvasapi2.models.DiscussionEntry in project instructure-android by instructure.
the class DiscussionEntryTest method depthTest_One.
@Test
public void depthTest_One() throws Exception {
DiscussionEntry entry = new DiscussionEntry();
DiscussionEntry parent = new DiscussionEntry();
entry.setParent(parent);
assertEquals(1, entry.getDepth());
}
use of com.instructure.canvasapi2.models.DiscussionEntry in project instructure-android by instructure.
the class DiscussionEntryTest method initTest_TotalChildrenOne.
@Test
public void initTest_TotalChildrenOne() throws Exception {
DiscussionTopic topic = new DiscussionTopic();
DiscussionEntry parent = new DiscussionEntry();
DiscussionEntry entry = new DiscussionEntry();
DiscussionEntry reply = new DiscussionEntry();
entry.addReply(reply);
entry.init(topic, parent);
assertEquals(1, entry.getTotalChildren());
}
Aggregations