use of com.instructure.canvasapi2.models.Student 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());
}
use of com.instructure.canvasapi2.models.Student in project instructure-android by instructure.
the class CourseTest method isTA_noTaEnrollment.
@Test
public void isTA_noTaEnrollment() {
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.isTA());
}
use of com.instructure.canvasapi2.models.Student in project instructure-android by instructure.
the class CourseTest method isCourseGradeLocked_hideFinal.
@Test
public void isCourseGradeLocked_hideFinal() {
Course course = new Course();
course.setHideFinalGrades(true);
Enrollment enrollment = new Enrollment();
enrollment.setType("student");
ArrayList<Enrollment> enrollments = new ArrayList<>();
enrollments.add(enrollment);
course.setEnrollments(enrollments);
assertTrue(course.getCourseGrade(false).isLocked());
}
use of com.instructure.canvasapi2.models.Student in project instructure-android by instructure.
the class CourseTest method courseGrade_currentGradeNonMGP.
@Test
public void courseGrade_currentGradeNonMGP() {
Course course = new Course();
String currentGrade = "A";
String finalGrade = "C";
Enrollment enrollment = new Enrollment();
enrollment.setType("student");
enrollment.setCurrentGradingPeriodId(27);
enrollment.setComputedCurrentGrade(currentGrade);
enrollment.setComputedFinalGrade(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.Student in project instructure-android by instructure.
the class CourseTest method courseGrade_finalGradeMGP.
@Test
public void courseGrade_finalGradeMGP() {
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.setCurrentPeriodComputedFinalGrade(finalGrade);
enrollment.setCurrentPeriodComputedCurrentGrade(currentGrade);
ArrayList<Enrollment> enrollments = new ArrayList<>();
enrollments.add(enrollment);
course.setEnrollments(enrollments);
assertTrue(course.getCourseGrade(false).getFinalGrade().equals(finalGrade));
}
Aggregations