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"));
}
Aggregations