Search in sources :

Example 1 with InstructorCourseStudentDeleteAction

use of teammates.ui.controller.InstructorCourseStudentDeleteAction in project teammates by TEAMMATES.

the class InstructorCourseStudentDeleteActionTest method testExecuteAndPostProcess.

@Override
@Test
public void testExecuteAndPostProcess() {
    InstructorAttributes instructor1OfCourse1 = typicalBundle.instructors.get("instructor1OfCourse1");
    StudentAttributes student1InCourse1 = typicalBundle.students.get("student1InCourse1");
    ______TS("success: delete a student ");
    gaeSimulation.loginAsInstructor(instructor1OfCourse1.googleId);
    String[] submissionParams = new String[] { Const.ParamsNames.COURSE_ID, instructor1OfCourse1.courseId, Const.ParamsNames.STUDENT_EMAIL, student1InCourse1.email };
    InstructorCourseStudentDeleteAction action = getAction(submissionParams);
    RedirectResult redirectResult = getRedirectResult(action);
    assertEquals(Const.ActionURIs.INSTRUCTOR_COURSE_DETAILS_PAGE, redirectResult.destination);
    assertFalse(redirectResult.isError);
    assertEquals(Const.StatusMessages.STUDENT_DELETED, redirectResult.getStatusMessage());
    AssertHelper.assertLogMessageEquals("TEAMMATESLOG|||instructorCourseStudentDelete|||instructorCourseStudentDelete|||" + "true|||Instructor|||Instructor 1 of Course 1|||idOfInstructor1OfCourse1|||" + "instr1@course1.tmt|||Student <span class=\"bold\">student1InCourse1@gmail.tmt</span> " + "in Course <span class=\"bold\">[idOfTypicalCourse1]</span> deleted.|||" + "/page/instructorCourseStudentDelete", action.getLogMessage());
}
Also used : RedirectResult(teammates.ui.controller.RedirectResult) StudentAttributes(teammates.common.datatransfer.attributes.StudentAttributes) InstructorAttributes(teammates.common.datatransfer.attributes.InstructorAttributes) InstructorCourseStudentDeleteAction(teammates.ui.controller.InstructorCourseStudentDeleteAction) Test(org.testng.annotations.Test)

Aggregations

Test (org.testng.annotations.Test)1 InstructorAttributes (teammates.common.datatransfer.attributes.InstructorAttributes)1 StudentAttributes (teammates.common.datatransfer.attributes.StudentAttributes)1 InstructorCourseStudentDeleteAction (teammates.ui.controller.InstructorCourseStudentDeleteAction)1 RedirectResult (teammates.ui.controller.RedirectResult)1