Search in sources :

Example 1 with DiscussionParticipant

use of com.instructure.canvasapi2.models.DiscussionParticipant 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());
}
Also used : ArrayList(java.util.ArrayList) DiscussionTopic(com.instructure.canvasapi2.models.DiscussionTopic) DiscussionParticipant(com.instructure.canvasapi2.models.DiscussionParticipant) Test(org.junit.Test)

Example 2 with DiscussionParticipant

use of com.instructure.canvasapi2.models.DiscussionParticipant 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]);
}
Also used : ArrayList(java.util.ArrayList) DiscussionTopic(com.instructure.canvasapi2.models.DiscussionTopic) DiscussionParticipant(com.instructure.canvasapi2.models.DiscussionParticipant) Test(org.junit.Test)

Aggregations

DiscussionParticipant (com.instructure.canvasapi2.models.DiscussionParticipant)2 DiscussionTopic (com.instructure.canvasapi2.models.DiscussionTopic)2 ArrayList (java.util.ArrayList)2 Test (org.junit.Test)2