Search in sources :

Example 1 with InstructorFeedbackRemindParticularStudentsPageAction

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

the class InstructorFeedbackRemindParticularStudentsPageActionTest method testExecuteAndPostProcess.

@Override
@Test
public void testExecuteAndPostProcess() {
    InstructorAttributes instructor1OfCourse1 = typicalBundle.instructors.get("instructor1OfCourse1");
    String instructorId = instructor1OfCourse1.googleId;
    CourseAttributes course = typicalBundle.courses.get("typicalCourse1");
    FeedbackSessionAttributes fsa = typicalBundle.feedbackSessions.get("session1InCourse1");
    gaeSimulation.loginAsInstructor(instructorId);
    ______TS("Not enough parameters");
    verifyAssumptionFailure();
    ______TS("Typical case");
    String[] submissionParams = new String[] { Const.ParamsNames.COURSE_ID, course.getId(), Const.ParamsNames.FEEDBACK_SESSION_NAME, fsa.getFeedbackSessionName() };
    InstructorFeedbackRemindParticularStudentsPageAction a = getAction(submissionParams);
    ShowPageResult r = getShowPageResult(a);
    assertFalse(r.isError);
    assertEquals("", r.getStatusMessage());
    InstructorFeedbackRemindParticularStudentsPageData pageData = (InstructorFeedbackRemindParticularStudentsPageData) r.data;
    assertEquals(6, pageData.getResponseStatus().studentsWhoDidNotRespond.size());
    assertEquals(3, pageData.getResponseStatus().studentsWhoResponded.size());
    assertTrue(pageData.getResponseStatus().studentsWhoResponded.contains("student1InCourse1@gmail.tmt"));
    assertFalse(pageData.getResponseStatus().studentsWhoDidNotRespond.contains("student2InCourse1@gmail.tmt"));
    assertTrue(pageData.getResponseStatus().studentsWhoResponded.contains("student3InCourse1@gmail.tmt"));
    assertTrue(pageData.getResponseStatus().studentsWhoDidNotRespond.contains("student4InCourse1@gmail.tmt"));
    assertFalse(pageData.getResponseStatus().studentsWhoResponded.contains("student5InCourse1@gmail.tmt"));
    assertFalse(pageData.getResponseStatus().studentsWhoDidNotRespond.contains("student6InCourse1@gmail.tmt"));
    assertFalse(pageData.getResponseStatus().studentsWhoDidNotRespond.contains("instructor1@course1.tmt"));
    assertTrue(pageData.getResponseStatus().studentsWhoDidNotRespond.contains("instructor2@course1.tmt"));
    assertTrue(pageData.getResponseStatus().studentsWhoDidNotRespond.contains("instructor3@course1.tmt"));
    assertFalse(pageData.getResponseStatus().studentsWhoDidNotRespond.contains("instructor4@course1.tmt"));
    assertTrue(pageData.getResponseStatus().studentsWhoDidNotRespond.contains("helper@course1.tmt"));
}
Also used : FeedbackSessionAttributes(teammates.common.datatransfer.attributes.FeedbackSessionAttributes) ShowPageResult(teammates.ui.controller.ShowPageResult) InstructorFeedbackRemindParticularStudentsPageData(teammates.ui.pagedata.InstructorFeedbackRemindParticularStudentsPageData) InstructorFeedbackRemindParticularStudentsPageAction(teammates.ui.controller.InstructorFeedbackRemindParticularStudentsPageAction) InstructorAttributes(teammates.common.datatransfer.attributes.InstructorAttributes) CourseAttributes(teammates.common.datatransfer.attributes.CourseAttributes) Test(org.testng.annotations.Test)

Aggregations

Test (org.testng.annotations.Test)1 CourseAttributes (teammates.common.datatransfer.attributes.CourseAttributes)1 FeedbackSessionAttributes (teammates.common.datatransfer.attributes.FeedbackSessionAttributes)1 InstructorAttributes (teammates.common.datatransfer.attributes.InstructorAttributes)1 InstructorFeedbackRemindParticularStudentsPageAction (teammates.ui.controller.InstructorFeedbackRemindParticularStudentsPageAction)1 ShowPageResult (teammates.ui.controller.ShowPageResult)1 InstructorFeedbackRemindParticularStudentsPageData (teammates.ui.pagedata.InstructorFeedbackRemindParticularStudentsPageData)1