Search in sources :

Example 1 with MasteryPathAssignment

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

the class MasteryPathAssignmentUnitTest method testMasteryPathAssignment.

@Test
public void testMasteryPathAssignment() {
    Gson gson = CanvasRestAdapter.getGSONParser();
    MasteryPathAssignment[] masteryPathAssignments = gson.fromJson(masteryPathAssignmentJSON, MasteryPathAssignment[].class);
    assertNotNull(masteryPathAssignments);
    assertTrue(masteryPathAssignments.length > 0);
    assertNotNull(masteryPathAssignments[0].getAssignment());
    // check the assignment
    Assignment assignment = masteryPathAssignments[0].getAssignment();
    assertTrue(assignment.getId() == 5);
    assertTrue(assignment.getPointsPossible() == 0);
    assertNotNull(assignment.getSubmissionTypes());
}
Also used : Assignment(com.instructure.canvasapi.model.Assignment) MasteryPathAssignment(com.instructure.canvasapi.model.MasteryPathAssignment) Gson(com.google.gson.Gson) MasteryPathAssignment(com.instructure.canvasapi.model.MasteryPathAssignment) Test(org.junit.Test)

Aggregations

Gson (com.google.gson.Gson)1 Assignment (com.instructure.canvasapi.model.Assignment)1 MasteryPathAssignment (com.instructure.canvasapi.model.MasteryPathAssignment)1 Test (org.junit.Test)1