use of org.edx.mobile.model.course.VideoBlockModel in project edx-app-android by edx.
the class CourseUnitVideoFragmentTest method getVideoUnit.
/**
* Method for iterating through the mock course response data, and
* returning the first video block leaf.
*
* @return The first {@link VideoBlockModel} leaf in the mock course data
*/
private VideoBlockModel getVideoUnit() {
EnrolledCoursesResponse courseData;
try {
courseData = executeStrict(courseAPI.getEnrolledCourses()).get(0);
} catch (Exception e) {
throw new RuntimeException(e);
}
String courseId = courseData.getCourse().getId();
CourseStructureV1Model model;
CourseComponent courseComponent;
try {
model = executeStrict(courseAPI.getCourseStructure(courseId));
courseComponent = (CourseComponent) CourseAPI.normalizeCourseStructure(model, courseId);
} catch (Exception e) {
throw new RuntimeException(e);
}
return (VideoBlockModel) courseComponent.getVideos().get(0);
}
Aggregations