use of teammates.ui.controller.InstructorStudentListAjaxPageAction in project teammates by TEAMMATES.
the class InstructorStudentListAjaxPageActionTest method testExecuteAndPostProcess.
@Override
@Test
public void testExecuteAndPostProcess() {
InstructorAttributes instructor = typicalBundle.instructors.get("instructor3OfCourse1");
String instructorId = instructor.googleId;
gaeSimulation.loginAsInstructor(instructorId);
______TS("Unsuccessful case: not enough parameters");
verifyAssumptionFailure();
String[] submissionParams = new String[] {};
verifyAssumptionFailure(submissionParams);
______TS("typical successful case");
submissionParams = new String[] { Const.ParamsNames.COURSE_ID, instructor.courseId, Const.ParamsNames.COURSE_INDEX, "1" };
InstructorStudentListAjaxPageAction action = getAction(submissionParams);
ShowPageResult result = getShowPageResult(action);
InstructorStudentListAjaxPageData data = (InstructorStudentListAjaxPageData) result.data;
assertEquals(2, data.getSections().size());
assertTrue(data.isHasSection());
assertEquals(1, data.getCourseIndex());
assertEquals(instructor.courseId, data.getCourseId());
}
Aggregations