use of com.instructure.canvasapi2.models.Enrollment 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());
}
use of com.instructure.canvasapi2.models.Enrollment in project instructure-android by instructure.
the class CourseTest method courseHasNoFinalGrade.
@Test
public void courseHasNoFinalGrade() {
Course course = new Course();
Enrollment enrollment = new Enrollment();
enrollment.setType("student");
enrollment.setComputedFinalGrade("");
enrollment.setComputedFinalScore(null);
ArrayList<Enrollment> enrollments = new ArrayList<>();
enrollments.add(enrollment);
course.setEnrollments(enrollments);
assertTrue(course.getCourseGrade(false).getNoFinalGrade());
}
use of com.instructure.canvasapi2.models.Enrollment in project instructure-android by instructure.
the class CourseTest method isStudent_noStudentEnrollment.
@Test
public void isStudent_noStudentEnrollment() {
Course course = new Course();
Enrollment enrollment = new Enrollment();
enrollment.setType("teacher");
ArrayList<Enrollment> enrollments = new ArrayList<>();
enrollments.add(enrollment);
course.setEnrollments(enrollments);
assertEquals(false, course.isStudent());
}
use of com.instructure.canvasapi2.models.Enrollment in project instructure-android by instructure.
the class CourseTest method courseGrade_currentScoreNonMGP.
@Test
public void courseGrade_currentScoreNonMGP() {
Course course = new Course();
double currentScore = 96.0;
double finalScore = 47.0;
Enrollment enrollment = new Enrollment();
enrollment.setType("student");
enrollment.setCurrentGradingPeriodId(27);
enrollment.setComputedCurrentScore(currentScore);
enrollment.setComputedFinalScore(finalScore);
ArrayList<Enrollment> enrollments = new ArrayList<>();
enrollments.add(enrollment);
course.setEnrollments(enrollments);
assertTrue(course.getCourseGrade(false).getCurrentScore() == currentScore);
}
use of com.instructure.canvasapi2.models.Enrollment in project instructure-android by instructure.
the class CourseTest method isTA_noEnrollments.
@Test
public void isTA_noEnrollments() {
Course course = new Course();
course.setEnrollments(new ArrayList<Enrollment>());
assertEquals(false, course.isTA());
}
Aggregations