use of com.instructure.canvasapi2.models.Conversation in project instructure-android by instructure.
the class ConversationTest method isMonologue_noAudience.
@Test
public void isMonologue_noAudience() {
Conversation conversation = new Conversation();
conversation.setAudience(null);
assertEquals(false, conversation.isMonologue(0L));
}
use of com.instructure.canvasapi2.models.Conversation in project instructure-android by instructure.
the class ConversationTest method getLastMessageSent.
@Test
public void getLastMessageSent() {
Conversation conversation = new Conversation();
conversation.setLastMessageAt("2008-09-15T15:53:00+05:00");
Date expectedDate = new Date(1221475980000L);
assertEquals(0, expectedDate.compareTo(conversation.getLastMessageSent()));
}
use of com.instructure.canvasapi2.models.Conversation in project instructure-android by instructure.
the class ConversationTest method getLastMessagePreview_deleted.
@Test
public void getLastMessagePreview_deleted() {
Conversation conversation = new Conversation();
conversation.setDeletedString("conversation deleted");
conversation.setLastMessage("last message");
conversation.setDeleted(true);
assertEquals("conversation deleted", conversation.getLastMessagePreview());
}
use of com.instructure.canvasapi2.models.Conversation in project instructure-android by instructure.
the class ConversationTest method isMonologue_userInAudience.
@Test
public void isMonologue_userInAudience() {
Conversation conversation = new Conversation();
ArrayList<Long> audience = new ArrayList<>();
audience.add(1L);
audience.add(2L);
audience.add(3L);
conversation.setAudience(audience);
assertEquals(true, conversation.isMonologue(1L));
}
use of com.instructure.canvasapi2.models.Conversation in project instructure-android by instructure.
the class ConversationTest method isMonologue_userNotInAudience.
@Test
public void isMonologue_userNotInAudience() {
Conversation conversation = new Conversation();
ArrayList<Long> audience = new ArrayList<>();
audience.add(1L);
audience.add(2L);
audience.add(3L);
conversation.setAudience(audience);
assertEquals(false, conversation.isMonologue(4L));
}
Aggregations