Search in sources :

Example 6 with Attachment

use of com.instructure.canvasapi.model.Attachment in project instructure-android by instructure.

the class ConversationUnitTest method testMessage.

// Gets tested from testConversation()
public static void testMessage(Message message) {
    assertNotNull(message);
    if (message.getAttachments() != null) {
        for (Attachment attachment : message.getAttachments()) {
            assertNotNull(attachment);
            assertTrue(attachment.getId() > 0);
            assertNotNull(attachment.getDisplayName());
            assertNotNull(attachment.getFilename());
            assertNotNull(attachment.getMimeType());
            assertNotNull(attachment.getUrl());
        }
    }
    assertTrue(message.getAuthorID() > 0);
    assertNotNull(message.getBody());
    assertNotNull(message.getCreationDate());
    assertTrue(message.getId() > 0);
    if (message.getForwardedMessages() != null) {
        for (Message replyMessage : message.getForwardedMessages()) {
            testMessage(replyMessage);
        }
    }
}
Also used : Message(com.instructure.canvasapi.model.Message) Attachment(com.instructure.canvasapi.model.Attachment)

Aggregations

Attachment (com.instructure.canvasapi.model.Attachment)6 View (android.view.View)2 Gson (com.google.gson.Gson)2 Submission (com.instructure.canvasapi.model.Submission)2 HelveticaTextView (com.instructure.speedgrader.views.HelveticaTextView)2 Test (org.junit.Test)2 RecyclerView (android.support.v7.widget.RecyclerView)1 AdapterView (android.widget.AdapterView)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1 TypeToken (com.google.gson.reflect.TypeToken)1 MediaComment (com.instructure.canvasapi.model.MediaComment)1 Message (com.instructure.canvasapi.model.Message)1 SubmissionComment (com.instructure.canvasapi.model.SubmissionComment)1 FilesAdapter (com.instructure.speedgrader.adapters.FilesAdapter)1 MediaUploadFragment (com.instructure.speedgrader.fragments.MediaUploadFragment)1 OnlineURLFragment (com.instructure.speedgrader.fragments.OnlineURLFragment)1 Callback (com.squareup.picasso.Callback)1 CircleImageView (de.hdodenhof.circleimageview.CircleImageView)1