Search in sources :

Example 76 with Assignment

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

the class AssignmentTest method isLocked_TestEmptyLockInfo.

@Test
public void isLocked_TestEmptyLockInfo() {
    Assignment assignment = new Assignment();
    LockInfo lockInfo = new LockInfo();
    assignment.setLockInfo(lockInfo);
    assertEquals(false, assignment.isLocked());
}
Also used : Assignment(com.instructure.canvasapi2.models.Assignment) LockInfo(com.instructure.canvasapi2.models.LockInfo) Test(org.junit.Test)

Example 77 with Assignment

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

the class AssignmentTest method hasRubric_TestTrue.

// endregion
@Test
public void hasRubric_TestTrue() {
    Assignment assignment = new Assignment();
    List<RubricCriterion> rubricCriterionList = new ArrayList<>();
    rubricCriterionList.add(new RubricCriterion());
    assignment.setRubric(rubricCriterionList);
    assertEquals(true, assignment.hasRubric());
}
Also used : Assignment(com.instructure.canvasapi2.models.Assignment) RubricCriterion(com.instructure.canvasapi2.models.RubricCriterion) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Example 78 with Assignment

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

the class AssignmentTest method isWithoutGradedSubmission_TestTrueNotNull.

@Test
public void isWithoutGradedSubmission_TestTrueNotNull() {
    Assignment assignment = new Assignment();
    Submission submission = new Submission();
    submission.setWorkflowState("submitted");
    submission.setGrade(null);
    submission.setSubmissionType(null);
    assignment.setSubmission(submission);
    assertEquals(true, assignment.isWithoutGradedSubmission());
}
Also used : Assignment(com.instructure.canvasapi2.models.Assignment) Submission(com.instructure.canvasapi2.models.Submission) Test(org.junit.Test)

Example 79 with Assignment

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

the class AssignmentTest method isWithoutGradedSubmission_TestTrueNull.

@Test
public void isWithoutGradedSubmission_TestTrueNull() {
    Assignment assignment = new Assignment();
    assignment.setSubmission(null);
    assertEquals(true, assignment.isWithoutGradedSubmission());
}
Also used : Assignment(com.instructure.canvasapi2.models.Assignment) Test(org.junit.Test)

Example 80 with Assignment

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

the class AssignmentTest method getLastActualSubmission_TestNullSubmission.

@Test
public void getLastActualSubmission_TestNullSubmission() {
    Assignment assignment = new Assignment();
    assignment.setSubmission(null);
    assertEquals(null, assignment.getLastActualSubmission());
}
Also used : Assignment(com.instructure.canvasapi2.models.Assignment) Test(org.junit.Test)

Aggregations

Assignment (com.instructure.canvasapi2.models.Assignment)62 Test (org.junit.Test)46 Submission (com.instructure.canvasapi2.models.Submission)25 Date (java.util.Date)18 ArrayList (java.util.ArrayList)15 View (android.view.View)10 RestBuilder (com.instructure.canvasapi2.builders.RestBuilder)10 Course (com.instructure.canvasapi2.models.Course)9 RestParams (com.instructure.canvasapi2.builders.RestParams)7 Bundle (android.os.Bundle)6 ScheduleItem (com.instructure.canvasapi2.models.ScheduleItem)6 LinkHeaders (com.instructure.canvasapi2.utils.LinkHeaders)6 Navigation (com.instructure.interactions.Navigation)5 DrawableRes (android.support.annotation.DrawableRes)4 AdapterView (android.widget.AdapterView)4 TextView (android.widget.TextView)4 Request (okhttp3.Request)4 Response (okhttp3.Response)4 Paint (android.graphics.Paint)3 Drawable (android.graphics.drawable.Drawable)3