use of com.instructure.canvasapi2.models.Enrollment in project instructure-android by instructure.
the class EnrollmentTest method isStudent_StudentEnrollment.
@Test
public void isStudent_StudentEnrollment() {
Enrollment enrollment = new Enrollment();
enrollment.setType("studentenrollment");
assertEquals(true, enrollment.isStudent());
}
use of com.instructure.canvasapi2.models.Enrollment in project instructure-android by instructure.
the class EnrollmentTest method getFinalGrade_NullGrades.
@Test
public void getFinalGrade_NullGrades() {
Enrollment enrollment = new Enrollment();
enrollment.setComputedFinalGrade("C-");
enrollment.setGrades(null);
assertEquals("C-", enrollment.getFinalGrade());
}
use of com.instructure.canvasapi2.models.Enrollment in project instructure-android by instructure.
the class EnrollmentTest method isObserver_Observer.
@Test
public void isObserver_Observer() {
Enrollment enrollment = new Enrollment();
enrollment.setType("observer");
assertEquals(true, enrollment.isObserver());
}
use of com.instructure.canvasapi2.models.Enrollment in project instructure-android by instructure.
the class EnrollmentTest method getFinalGrade.
@Test
public void getFinalGrade() {
Grades grades = new Grades();
grades.setFinalGrade("B+");
Enrollment enrollment = new Enrollment();
enrollment.setComputedFinalGrade("C-");
enrollment.setGrades(grades);
assertEquals("B+", enrollment.getFinalGrade());
}
use of com.instructure.canvasapi2.models.Enrollment in project instructure-android by instructure.
the class EnrollmentManager method getSelfEnrollments.
public static void getSelfEnrollments(@Nullable final List<String> types, @Nullable final List<String> states, boolean forceNetwork, @NonNull StatusCallback<List<Enrollment>> callback) {
if (isTesting() || mTesting) {
} else {
final RestBuilder adapter = new RestBuilder(callback);
final RestParams params = new RestParams.Builder().withPerPageQueryParam(true).withForceReadFromNetwork(forceNetwork).build();
StatusCallback<List<Enrollment>> depaginatedCallback = new ExhaustiveListCallback<Enrollment>(callback) {
@Override
public void getNextPage(@NonNull StatusCallback<List<Enrollment>> callback, @NonNull String nextUrl, boolean isCached) {
EnrollmentAPI.getSelfEnrollments(types, states, adapter, params, callback);
}
};
adapter.setStatusCallback(depaginatedCallback);
EnrollmentAPI.getSelfEnrollments(types, states, adapter, params, callback);
}
}
Aggregations