use of com.instructure.canvasapi2.models.Course in project instructure-android by instructure.
the class CourseTest method courseGrade_finalScoreNonMGP.
@Test
public void courseGrade_finalScoreNonMGP() {
Course course = new Course();
double currentScore = 96.0;
double finalScore = 47.0;
Enrollment enrollment = new Enrollment();
enrollment.setType("student");
enrollment.setComputedFinalScore(finalScore);
enrollment.setComputedCurrentScore(currentScore);
ArrayList<Enrollment> enrollments = new ArrayList<>();
enrollments.add(enrollment);
course.setEnrollments(enrollments);
assertTrue(course.getCourseGrade(false).getFinalScore() == finalScore);
}
use of com.instructure.canvasapi2.models.Course in project instructure-android by instructure.
the class CourseTest method isTA_hasTaEnrollment.
@Test
public void isTA_hasTaEnrollment() {
Course course = new Course();
Enrollment enrollment = new Enrollment();
enrollment.setType("ta");
ArrayList<Enrollment> enrollments = new ArrayList<>();
enrollments.add(enrollment);
course.setEnrollments(enrollments);
assertEquals(true, course.isTA());
}
use of com.instructure.canvasapi2.models.Course in project instructure-android by instructure.
the class CourseTest method isTeacher_noTeacherEnrollment.
@Test
public void isTeacher_noTeacherEnrollment() {
Course course = new Course();
Enrollment enrollment = new Enrollment();
enrollment.setType("student");
ArrayList<Enrollment> enrollments = new ArrayList<>();
enrollments.add(enrollment);
course.setEnrollments(enrollments);
assertEquals(false, course.isTeacher());
}
use of com.instructure.canvasapi2.models.Course in project instructure-android by instructure.
the class CourseTest method getLicense_CC_ATTRIBUTION_SHARE_ALIKE.
@Test
public void getLicense_CC_ATTRIBUTION_SHARE_ALIKE() {
Course course = new Course();
course.setLicense("cc_by_sa");
assertEquals(Course.LICENSE.CC_ATTRIBUTION_SHARE_ALIKE, course.getLicense());
}
use of com.instructure.canvasapi2.models.Course in project instructure-android by instructure.
the class CourseTest method isStudent_hasStudentEnrollment.
@Test
public void isStudent_hasStudentEnrollment() {
Course course = new Course();
Enrollment enrollment = new Enrollment();
enrollment.setType("student");
ArrayList<Enrollment> enrollments = new ArrayList<>();
enrollments.add(enrollment);
course.setEnrollments(enrollments);
assertEquals(true, course.isStudent());
}
Aggregations