use of com.instructure.canvasapi2.models.Enrollment in project instructure-android by instructure.
the class CourseTest method courseGrade_finalGradeNonMGP.
@Test
public void courseGrade_finalGradeNonMGP() {
Course course = new Course();
String currentGrade = "A";
String finalGrade = "C";
Enrollment enrollment = new Enrollment();
enrollment.setType("student");
enrollment.setComputedFinalGrade(finalGrade);
enrollment.setComputedCurrentGrade(currentGrade);
ArrayList<Enrollment> enrollments = new ArrayList<>();
enrollments.add(enrollment);
course.setEnrollments(enrollments);
assertTrue(course.getCourseGrade(false).getFinalGrade().equals(finalGrade));
}
use of com.instructure.canvasapi2.models.Enrollment in project instructure-android by instructure.
the class CourseTest method courseGrade_currentGradeMGP.
@Test
public void courseGrade_currentGradeMGP() {
Course course = new Course();
course.setHasGradingPeriods(true);
String currentGrade = "A";
String finalGrade = "C";
Enrollment enrollment = new Enrollment();
enrollment.setType("student");
enrollment.setCurrentGradingPeriodId(27);
enrollment.setMultipleGradingPeriodsEnabled(true);
enrollment.setCurrentPeriodComputedCurrentGrade(currentGrade);
enrollment.setCurrentPeriodComputedFinalGrade(finalGrade);
ArrayList<Enrollment> enrollments = new ArrayList<>();
enrollments.add(enrollment);
course.setEnrollments(enrollments);
assertTrue(course.getCourseGrade(false).getCurrentGrade().equals(currentGrade));
}
use of com.instructure.canvasapi2.models.Enrollment in project instructure-android by instructure.
the class EnrollmentTest method getCurrentScore_NullGrades.
@Test
public void getCurrentScore_NullGrades() {
Enrollment enrollment = new Enrollment();
enrollment.setComputedCurrentScore(50.0);
enrollment.setGrades(null);
assertEquals(50.0, enrollment.getCurrentScore(), 0.001);
}
use of com.instructure.canvasapi2.models.Enrollment in project instructure-android by instructure.
the class EnrollmentTest method getFinalScore.
@Test
public void getFinalScore() {
Grades grades = new Grades();
grades.setFinalScore(95.0);
Enrollment enrollment = new Enrollment();
enrollment.setComputedFinalScore(50.0);
enrollment.setGrades(grades);
assertEquals(95.0, enrollment.getFinalScore(), 0.001);
}
use of com.instructure.canvasapi2.models.Enrollment in project instructure-android by instructure.
the class EnrollmentTest method getCurrentScore.
@Test
public void getCurrentScore() {
Grades grades = new Grades();
grades.setCurrentScore(95.0);
Enrollment enrollment = new Enrollment();
enrollment.setComputedCurrentScore(50.0);
enrollment.setGrades(grades);
assertEquals(95.0, enrollment.getCurrentScore(), 0.001);
}
Aggregations