use of teammates.ui.pagedata.InstructorCourseEnrollPageData in project teammates by TEAMMATES.
the class InstructorCourseEnrollPageDataTest method testAll.
@Test
public void testAll() {
______TS("test typical case");
AccountAttributes account = dataBundle.accounts.get("instructor1OfCourse1");
String courseId = "CourseId";
String enroll = "Section | Team | Name | Email | Comments\n" + "Tut Group 1 | Team 1 | Tom Jacobs | tom@email.com\n" + "Tut Group 1 | Team 1 | Jean Wong | jean@email.com | Exchange Student\n" + "Tut Group 1 | Team 2 | Jack Wayne | jack@email.com\n" + "Tut Group 2 | Team 3 | Thora Parker | thora@email.com";
InstructorCourseEnrollPageData pageData = new InstructorCourseEnrollPageData(account, dummySessionToken, courseId, enroll);
assertNotNull(pageData.getCourseId());
assertEquals(courseId, pageData.getCourseId());
assertNotNull(pageData.getEnrollStudents());
assertEquals(enroll, pageData.getEnrollStudents());
assertNotNull(pageData.account);
assertEquals(account.googleId, pageData.account.googleId);
}
use of teammates.ui.pagedata.InstructorCourseEnrollPageData in project teammates by TEAMMATES.
the class InstructorCourseEnrollPageActionTest method visitEnrollPage_inMasqueradeMode.
private void visitEnrollPage_inMasqueradeMode() {
______TS("Masquerade mode");
gaeSimulation.loginAsAdmin("admin.user");
InstructorAttributes instructorToMasquerade = typicalBundle.instructors.get("instructor4");
String instructorId = instructorToMasquerade.googleId;
String courseId = instructorToMasquerade.courseId;
String[] submissionParams = new String[] { Const.ParamsNames.USER_ID, instructorId, Const.ParamsNames.COURSE_ID, courseId };
InstructorCourseEnrollPageAction enrollPageAction = getAction(submissionParams);
ShowPageResult pageResult = getShowPageResult(enrollPageAction);
assertEquals(getPageResultDestination(Const.ViewURIs.INSTRUCTOR_COURSE_ENROLL, false, "idOfInstructor4"), pageResult.getDestinationWithParams());
assertFalse(pageResult.isError);
assertEquals("", pageResult.getStatusMessage());
InstructorCourseEnrollPageData pageData = (InstructorCourseEnrollPageData) pageResult.data;
assertEquals(courseId, pageData.getCourseId());
assertNull(pageData.getEnrollStudents());
String expectedLogSegment = String.format(Const.StatusMessages.ADMIN_LOG_INSTRUCTOR_COURSE_ENROLL_PAGE_LOAD, courseId);
AssertHelper.assertContains(expectedLogSegment, enrollPageAction.getLogMessage());
}
Aggregations