use of com.instructure.canvasapi2.models.DiscussionTopic in project instructure-android by instructure.
the class DiscussionManager method getFullDiscussionTopic.
public static void getFullDiscussionTopic(CanvasContext canvasContext, long topicId, boolean forceNetwork, StatusCallback<DiscussionTopic> callback) {
if (isTesting() || mTesting) {
// TODO:
} else {
RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().withForceReadFromNetwork(forceNetwork).build();
DiscussionAPI.getFullDiscussionTopic(adapter, canvasContext, topicId, callback, params);
}
}
use of com.instructure.canvasapi2.models.DiscussionTopic 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.DiscussionTopic in project instructure-android by instructure.
the class DiscussionTopicTest method getParticipantsMap_Size.
@Test
public void getParticipantsMap_Size() throws Exception {
DiscussionTopic topic = new DiscussionTopic();
ArrayList<DiscussionParticipant> participants = new ArrayList<>();
DiscussionParticipant participant = new DiscussionParticipant();
participant.setId(64343L);
participants.add(participant);
topic.setParticipants(participants);
assertEquals(1, topic.getParticipantsMap().size());
}
use of com.instructure.canvasapi2.models.DiscussionTopic in project instructure-android by instructure.
the class DiscussionTopicTest method getParticipantsMap_Content.
@Test
public void getParticipantsMap_Content() throws Exception {
long id = 534234L;
DiscussionTopic topic = new DiscussionTopic();
ArrayList<DiscussionParticipant> participants = new ArrayList<>();
DiscussionParticipant participant = new DiscussionParticipant();
participant.setId(id);
participants.add(participant);
topic.setParticipants(participants);
assertEquals(id, topic.getParticipantsMap().keySet().toArray()[0]);
}
Aggregations