use of com.instructure.canvasapi2.models.Course in project instructure-android by instructure.
the class CourseTest method getLicense_CC_ATTRIBUTION.
@Test
public void getLicense_CC_ATTRIBUTION() {
Course course = new Course();
course.setLicense("cc_by");
assertEquals(Course.LICENSE.CC_ATTRIBUTION, course.getLicense());
}
use of com.instructure.canvasapi2.models.Course in project instructure-android by instructure.
the class CourseTest method addEnrollment.
@Test
public void addEnrollment() {
Course course = new Course();
course.setEnrollments(null);
Enrollment enrollment = new Enrollment();
course.addEnrollment(enrollment);
assertEquals(true, course.getEnrollments().contains(enrollment));
}
use of com.instructure.canvasapi2.models.Course in project instructure-android by instructure.
the class CourseTest method isCourseGradeLocked_hideAllGradingPeriods.
@Test
public void isCourseGradeLocked_hideAllGradingPeriods() {
Course course = new Course();
course.setHasGradingPeriods(true);
Enrollment enrollment = new Enrollment();
enrollment.setType("student");
enrollment.setCurrentGradingPeriodId(0);
enrollment.setMultipleGradingPeriodsEnabled(true);
enrollment.setTotalsForAllGradingPeriodsOption(false);
ArrayList<Enrollment> enrollments = new ArrayList<>();
enrollments.add(enrollment);
course.setEnrollments(enrollments);
assertTrue(course.getCourseGrade(false).isLocked());
}
use of com.instructure.canvasapi2.models.Course in project instructure-android by instructure.
the class CourseTest method isTeacher_noEnrollments.
@Test
public void isTeacher_noEnrollments() {
Course course = new Course();
course.setEnrollments(new ArrayList<Enrollment>());
assertEquals(false, course.isTeacher());
}
use of com.instructure.canvasapi2.models.Course in project instructure-android by instructure.
the class CourseTest method courseHasFinalGrade.
@Test
public void courseHasFinalGrade() {
Course course = new Course();
Enrollment enrollment = new Enrollment();
enrollment.setType("student");
enrollment.setComputedFinalGrade("A");
enrollment.setComputedFinalScore(95.0);
ArrayList<Enrollment> enrollments = new ArrayList<>();
enrollments.add(enrollment);
course.setEnrollments(enrollments);
assertFalse(course.getCourseGrade(false).getNoFinalGrade());
}
Aggregations