use of com.instructure.canvasapi2.models.Student in project instructure-android by instructure.
the class CourseTest method courseHasCurrentGrade.
@Test
public void courseHasCurrentGrade() {
Course course = new Course();
Enrollment enrollment = new Enrollment();
enrollment.setType("student");
enrollment.setComputedCurrentGrade("A");
enrollment.setComputedCurrentScore(95.0);
ArrayList<Enrollment> enrollments = new ArrayList<>();
enrollments.add(enrollment);
course.setEnrollments(enrollments);
assertFalse(course.getCourseGrade(false).getNoCurrentGrade());
}
use of com.instructure.canvasapi2.models.Student 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.Student 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.Student in project instructure-android by instructure.
the class EnrollmentTest method isStudent_Student.
@Test
public void isStudent_Student() {
Enrollment enrollment = new Enrollment();
enrollment.setType("student");
assertEquals(true, enrollment.isStudent());
}
use of com.instructure.canvasapi2.models.Student in project instructure-android by instructure.
the class EnrollmentTest method getType.
@Test
public void getType() {
Enrollment enrollment = new Enrollment();
enrollment.setType("studentenrollment");
assertEquals("student", enrollment.getType());
}
Aggregations