Search in sources :

Example 1 with InstructorFeedbackEditCopyPageAction

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

the class InstructorFeedbackEditCopyPageActionTest method testExecuteAndPostProcess.

@Override
@Test
public void testExecuteAndPostProcess() {
    InstructorAttributes instructor = dataBundle.instructors.get("teammates.test.instructor2");
    String instructorId = instructor.googleId;
    gaeSimulation.loginAsInstructor(instructorId);
    ______TS("Successful case");
    String[] submissionParams = { Const.ParamsNames.COURSE_ID, "valid course id", Const.ParamsNames.FEEDBACK_SESSION_NAME, "valid fs name" };
    InstructorFeedbackEditCopyPageAction a = getAction(submissionParams);
    ShowPageResult r = getShowPageResult(a);
    assertFalse(r.isError);
    InstructorFeedbackEditCopyPageData pageData = (InstructorFeedbackEditCopyPageData) r.data;
    assertEquals(4, pageData.getCourses().size());
    List<String> idOfCourses = new ArrayList<>();
    for (CourseAttributes course : pageData.getCourses()) {
        idOfCourses.add(course.getId());
    }
    // course is archived
    assertFalse(idOfCourses.contains("FeedbackEditCopy.CS1101"));
    // instructor does not have sufficient permissions
    assertFalse(idOfCourses.contains("FeedbackEditCopy.CS2107"));
    assertTrue(idOfCourses.contains("FeedbackEditCopy.CS2102"));
    assertTrue(idOfCourses.contains("FeedbackEditCopy.CS2103"));
    assertTrue(idOfCourses.contains("FeedbackEditCopy.CS2103R"));
    assertTrue(idOfCourses.contains("FeedbackEditCopy.CS2104"));
}
Also used : InstructorFeedbackEditCopyPageData(teammates.ui.pagedata.InstructorFeedbackEditCopyPageData) ShowPageResult(teammates.ui.controller.ShowPageResult) InstructorFeedbackEditCopyPageAction(teammates.ui.controller.InstructorFeedbackEditCopyPageAction) ArrayList(java.util.ArrayList) InstructorAttributes(teammates.common.datatransfer.attributes.InstructorAttributes) CourseAttributes(teammates.common.datatransfer.attributes.CourseAttributes) Test(org.testng.annotations.Test)

Aggregations

ArrayList (java.util.ArrayList)1 Test (org.testng.annotations.Test)1 CourseAttributes (teammates.common.datatransfer.attributes.CourseAttributes)1 InstructorAttributes (teammates.common.datatransfer.attributes.InstructorAttributes)1 InstructorFeedbackEditCopyPageAction (teammates.ui.controller.InstructorFeedbackEditCopyPageAction)1 ShowPageResult (teammates.ui.controller.ShowPageResult)1 InstructorFeedbackEditCopyPageData (teammates.ui.pagedata.InstructorFeedbackEditCopyPageData)1