Search in sources :

Example 6 with DiscussionTopicHeader

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

the class DiscussionTopicHeaderTest method convertToDiscussionEntryTest_Null.

@Test
public void convertToDiscussionEntryTest_Null() throws Exception {
    DiscussionTopicHeader header = new DiscussionTopicHeader();
    assertNotNull(header.convertToDiscussionEntry("localized_graded", "localized_points"));
}
Also used : DiscussionTopicHeader(com.instructure.canvasapi2.models.DiscussionTopicHeader) Test(org.junit.Test)

Example 7 with DiscussionTopicHeader

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

the class DiscussionTopicHeaderTest method convertToDiscussionEntryTest_Description.

@Test
public void convertToDiscussionEntryTest_Description() throws Exception {
    String localized_graded = "Graded discussion";
    DiscussionTopicHeader header = new DiscussionTopicHeader();
    Assignment assignment = new Assignment();
    header.setAssignment(assignment);
    DiscussionEntry entry = header.convertToDiscussionEntry(localized_graded, "points");
    assertEquals(localized_graded, entry.getDescription());
}
Also used : Assignment(com.instructure.canvasapi2.models.Assignment) DiscussionTopicHeader(com.instructure.canvasapi2.models.DiscussionTopicHeader) DiscussionEntry(com.instructure.canvasapi2.models.DiscussionEntry) Test(org.junit.Test)

Example 8 with DiscussionTopicHeader

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

the class DiscussionTopicHeaderTest method getStatusTest_Read.

@Test
public void getStatusTest_Read() throws Exception {
    DiscussionTopicHeader discussionTopicHeader = new DiscussionTopicHeader();
    discussionTopicHeader.setReadState("read");
    assertEquals(DiscussionTopicHeader.ReadState.READ, discussionTopicHeader.getStatus());
}
Also used : DiscussionTopicHeader(com.instructure.canvasapi2.models.DiscussionTopicHeader) Test(org.junit.Test)

Example 9 with DiscussionTopicHeader

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

the class DiscussionTopicHeaderTest method convertToDiscussionEntryTest_ParentID.

@Test
public void convertToDiscussionEntryTest_ParentID() throws Exception {
    DiscussionTopicHeader header = new DiscussionTopicHeader();
    DiscussionEntry entry = header.convertToDiscussionEntry("grade", "points");
    assertEquals(-1, entry.getParentId());
}
Also used : DiscussionTopicHeader(com.instructure.canvasapi2.models.DiscussionTopicHeader) DiscussionEntry(com.instructure.canvasapi2.models.DiscussionEntry) Test(org.junit.Test)

Example 10 with DiscussionTopicHeader

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

the class DiscussionTopicHeaderTest method getStatusTest_Other.

@Test
public void getStatusTest_Other() throws Exception {
    DiscussionTopicHeader discussionTopicHeader = new DiscussionTopicHeader();
    discussionTopicHeader.setReadState("anything_else");
    assertEquals(DiscussionTopicHeader.ReadState.UNREAD, discussionTopicHeader.getStatus());
}
Also used : DiscussionTopicHeader(com.instructure.canvasapi2.models.DiscussionTopicHeader) Test(org.junit.Test)

Aggregations

DiscussionTopicHeader (com.instructure.canvasapi2.models.DiscussionTopicHeader)24 RestBuilder (com.instructure.canvasapi2.builders.RestBuilder)20 RestParams (com.instructure.canvasapi2.builders.RestParams)19 Test (org.junit.Test)17 List (java.util.List)6 StatusCallback (com.instructure.canvasapi2.StatusCallback)4 DiscussionEntry (com.instructure.canvasapi2.models.DiscussionEntry)4 ExhaustiveListCallback (com.instructure.canvasapi2.utils.ExhaustiveListCallback)4 ArrayList (java.util.ArrayList)4 NotNull (org.jetbrains.annotations.NotNull)4 DateTime (hirondelle.date4j.DateTime)3 Date (java.util.Date)3 Assignment (com.instructure.canvasapi2.models.Assignment)2 Course (com.instructure.canvasapi2.models.Course)2 LinkHeaders (com.instructure.canvasapi2.utils.LinkHeaders)2 Response (okhttp3.Response)2 ViewGroup (android.view.ViewGroup)1 AccountNotification (com.instructure.canvasapi2.models.AccountNotification)1 Group (com.instructure.canvasapi2.models.Group)1 ScheduleItem (com.instructure.canvasapi2.models.ScheduleItem)1