Search in sources :

Example 1 with InstructorStudentListAjaxPageAction

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());
}
Also used : ShowPageResult(teammates.ui.controller.ShowPageResult) InstructorStudentListAjaxPageData(teammates.ui.pagedata.InstructorStudentListAjaxPageData) InstructorStudentListAjaxPageAction(teammates.ui.controller.InstructorStudentListAjaxPageAction) InstructorAttributes(teammates.common.datatransfer.attributes.InstructorAttributes) Test(org.testng.annotations.Test)

Aggregations

Test (org.testng.annotations.Test)1 InstructorAttributes (teammates.common.datatransfer.attributes.InstructorAttributes)1 InstructorStudentListAjaxPageAction (teammates.ui.controller.InstructorStudentListAjaxPageAction)1 ShowPageResult (teammates.ui.controller.ShowPageResult)1 InstructorStudentListAjaxPageData (teammates.ui.pagedata.InstructorStudentListAjaxPageData)1