Search in sources :

Example 31 with Conversation

use of com.instructure.canvasapi2.models.Conversation in project instructure-android by instructure.

the class ConversationTest method getLastAuthoredMessageSent.

@Test
public void getLastAuthoredMessageSent() {
    Conversation conversation = new Conversation();
    conversation.setLastAuthoredMessageAt("2008-09-15T15:53:00+05:00");
    Date expectedDate = new Date(1221475980000L);
    assertEquals(0, expectedDate.compareTo(conversation.getLastAuthoredMessageSent()));
}
Also used : Conversation(com.instructure.canvasapi2.models.Conversation) Date(java.util.Date) Test(org.junit.Test)

Example 32 with Conversation

use of com.instructure.canvasapi2.models.Conversation in project instructure-android by instructure.

the class ConversationTest method getWorkflowState_archived.

@Test
public void getWorkflowState_archived() {
    Conversation conversation = new Conversation();
    conversation.setWorkflowState("ARCHIVED");
    assertEquals(Conversation.WorkflowState.ARCHIVED, conversation.getWorkflowState());
}
Also used : Conversation(com.instructure.canvasapi2.models.Conversation) Test(org.junit.Test)

Example 33 with Conversation

use of com.instructure.canvasapi2.models.Conversation in project instructure-android by instructure.

the class ConversationTest method isMonologue_emptyAudience.

@Test
public void isMonologue_emptyAudience() {
    Conversation conversation = new Conversation();
    conversation.setAudience(new ArrayList<Long>());
    assertEquals(true, conversation.isMonologue(0L));
}
Also used : Conversation(com.instructure.canvasapi2.models.Conversation) Test(org.junit.Test)

Example 34 with Conversation

use of com.instructure.canvasapi2.models.Conversation in project instructure-android by instructure.

the class ConversationTest method getWorkflowState_unread.

@Test
public void getWorkflowState_unread() {
    Conversation conversation = new Conversation();
    conversation.setWorkflowState("unread");
    assertEquals(Conversation.WorkflowState.UNREAD, conversation.getWorkflowState());
}
Also used : Conversation(com.instructure.canvasapi2.models.Conversation) Test(org.junit.Test)

Example 35 with Conversation

use of com.instructure.canvasapi2.models.Conversation in project instructure-android by instructure.

the class ConversationTest method getWorkflowState_unknown.

@Test
public void getWorkflowState_unknown() {
    Conversation conversation = new Conversation();
    assertEquals(Conversation.WorkflowState.UNKNOWN, conversation.getWorkflowState());
}
Also used : Conversation(com.instructure.canvasapi2.models.Conversation) Test(org.junit.Test)

Aggregations

Conversation (com.instructure.canvasapi2.models.Conversation)28 RestBuilder (com.instructure.canvasapi2.builders.RestBuilder)20 Test (org.junit.Test)14 RestParams (com.instructure.canvasapi2.builders.RestParams)12 LinkHeaders (com.instructure.canvasapi2.utils.LinkHeaders)9 Response (okhttp3.Response)8 ArrayList (java.util.ArrayList)7 IOException (java.io.IOException)3 List (java.util.List)3 Nullable (android.support.annotation.Nullable)2 Date (java.util.Date)2 Bundle (android.os.Bundle)1 Rfc822Tokenizer (android.text.util.Rfc822Tokenizer)1 Menu (android.view.Menu)1 View (android.view.View)1 AdapterView (android.widget.AdapterView)1 ImageView (android.widget.ImageView)1 ScrollView (android.widget.ScrollView)1 TextView (android.widget.TextView)1 BindView (butterknife.BindView)1