use of com.instructure.canvasapi2.models.Enrollment in project instructure-android by instructure.
the class CourseTest method courseGrade_finalScoreMGP.
@Test
public void courseGrade_finalScoreMGP() {
Course course = new Course();
course.setHasGradingPeriods(true);
double currentScore = 96.0;
double finalScore = 47.0;
Enrollment enrollment = new Enrollment();
enrollment.setType("student");
enrollment.setCurrentGradingPeriodId(27);
enrollment.setMultipleGradingPeriodsEnabled(true);
enrollment.setCurrentPeriodComputedFinalScore(finalScore);
enrollment.setCurrentPeriodComputedCurrentScore(currentScore);
ArrayList<Enrollment> enrollments = new ArrayList<>();
enrollments.add(enrollment);
course.setEnrollments(enrollments);
assertTrue(course.getCourseGrade(false).getFinalScore() == finalScore);
}
use of com.instructure.canvasapi2.models.Enrollment in project instructure-android by instructure.
the class EnrollmentTest method getCurrentGrade.
@Test
public void getCurrentGrade() {
Grades grades = new Grades();
grades.setCurrentGrade("B+");
Enrollment enrollment = new Enrollment();
enrollment.setComputedCurrentGrade("C-");
enrollment.setGrades(grades);
assertEquals("B+", enrollment.getCurrentGrade());
}
use of com.instructure.canvasapi2.models.Enrollment in project instructure-android by instructure.
the class EnrollmentTest method isTa_Ta.
@Test
public void isTa_Ta() {
Enrollment enrollment = new Enrollment();
enrollment.setType("ta");
assertEquals(true, enrollment.isTA());
}
use of com.instructure.canvasapi2.models.Enrollment in project instructure-android by instructure.
the class EnrollmentTest method getFinalScore_NullGrades.
@Test
public void getFinalScore_NullGrades() {
Enrollment enrollment = new Enrollment();
enrollment.setComputedFinalScore(50.0);
enrollment.setGrades(null);
assertEquals(50.0, enrollment.getFinalScore(), 0.001);
}
use of com.instructure.canvasapi2.models.Enrollment in project instructure-android by instructure.
the class EnrollmentTest method isTeacher_TeacherEnrollment.
@Test
public void isTeacher_TeacherEnrollment() {
Enrollment enrollment = new Enrollment();
enrollment.setType("teacherenrollment");
assertEquals(true, enrollment.isTeacher());
}
Aggregations