Search in sources :

Example 6 with RubricCriterion

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

the class RubricCriterionUnitTest method testRubricCriterion.

@Test
public void testRubricCriterion() {
    Gson gson = CanvasRestAdapter.getGSONParser();
    RubricCriterion[] rubricCriterions = gson.fromJson(rubricCriterionJSON, RubricCriterion[].class);
    assertNotNull(rubricCriterions);
    for (RubricCriterion rubricCriterion : rubricCriterions) {
        assertNotNull(rubricCriterion);
        assertNotNull(rubricCriterion.getCriterionDescription());
        assertNotNull(rubricCriterion.getId());
        assertTrue(rubricCriterion.getPoints() >= 0);
    }
}
Also used : RubricCriterion(com.instructure.canvasapi.model.RubricCriterion) Gson(com.google.gson.Gson) Test(org.junit.Test)

Example 7 with RubricCriterion

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

the class RubricCriterionUnitTest method testRubricCriterionRating.

@Test
public void testRubricCriterionRating() {
    Gson gson = CanvasRestAdapter.getGSONParser();
    RubricCriterion[] rubricCriterions = gson.fromJson(rubricCriterionJSON, RubricCriterion[].class);
    for (RubricCriterion rubricCriterion : rubricCriterions) {
        if (rubricCriterion.getGradedCriterionRating() != null) {
            List<RubricCriterionRating> ratings = rubricCriterion.getRatings();
            for (RubricCriterionRating rubricCriterionRating : ratings) {
                assertNotNull(rubricCriterionRating.getId());
                assertNotNull(rubricCriterionRating.getRatingDescription());
            }
        }
    }
}
Also used : RubricCriterionRating(com.instructure.canvasapi.model.RubricCriterionRating) RubricCriterion(com.instructure.canvasapi.model.RubricCriterion) Gson(com.google.gson.Gson) Test(org.junit.Test)

Aggregations

RubricCriterion (com.instructure.canvasapi.model.RubricCriterion)7 Gson (com.google.gson.Gson)4 RubricCriterionRating (com.instructure.canvasapi.model.RubricCriterionRating)4 Test (org.junit.Test)4 Assignment (com.instructure.canvasapi.model.Assignment)1