use of teammates.ui.controller.StudentProfilePictureEditAction in project teammates by TEAMMATES.
the class StudentProfilePictureEditActionTest method testActionForNonExistentBlobKey.
private void testActionForNonExistentBlobKey(AccountAttributes student) {
______TS("Failure case: non-existent blobKey");
String expectedUrl = getPageResultDestination(Const.ActionURIs.STUDENT_PROFILE_PAGE, true, student.googleId);
String[] submissionParams = createValidParamsForProfilePictureEdit();
StudentProfilePictureEditAction action = getAction(submissionParams);
RedirectResult result = getRedirectResult(action);
String expectedLogMessage = getExpectedLogMessageNonExistentBlob(student);
AssertHelper.assertLogMessageEquals(expectedLogMessage, action.getLogMessage());
assertEquals(expectedUrl, result.getDestinationWithParams());
}
use of teammates.ui.controller.StudentProfilePictureEditAction in project teammates by TEAMMATES.
the class StudentProfilePictureEditActionTest method testActionForEmptyLeftX.
private void testActionForEmptyLeftX(AccountAttributes student) {
______TS("Failure case: empty parameter - leftx");
String expectedUrl = getPageResultDestination(Const.ActionURIs.STUDENT_PROFILE_PAGE, true, student.googleId);
String[] submissionParams = createValidParamsForProfilePictureEdit();
submissionParams[1] = "";
StudentProfilePictureEditAction action = getAction(submissionParams);
RedirectResult result = getRedirectResult(action);
String expectedLogMessage = getExpectedLogMessageEmptyCoords(student);
AssertHelper.assertLogMessageEquals(expectedLogMessage, action.getLogMessage());
assertEquals(expectedUrl, result.getDestinationWithParams());
}
use of teammates.ui.controller.StudentProfilePictureEditAction in project teammates by TEAMMATES.
the class StudentProfilePictureEditActionTest method testActionForZeroHeight.
private void testActionForZeroHeight(AccountAttributes student) {
______TS("Failure case: zero height");
String expectedLogMessage = getExpectedLogMessageZeroDimensions(student);
String expectedUrl = getPageResultDestination(Const.ActionURIs.STUDENT_PROFILE_PAGE, true, student.googleId);
String[] submissionParams = createValidParamsForProfilePictureEdit();
submissionParams[9] = "0";
StudentProfilePictureEditAction action = getAction(submissionParams);
RedirectResult result = getRedirectResult(action);
AssertHelper.assertLogMessageEquals(expectedLogMessage, action.getLogMessage());
assertEquals(expectedUrl, result.getDestinationWithParams());
}
use of teammates.ui.controller.StudentProfilePictureEditAction in project teammates by TEAMMATES.
the class StudentProfilePictureEditActionTest method testActionForEmptyRightY.
private void testActionForEmptyRightY(AccountAttributes student) {
String[] submissionParams;
______TS("Failure case: empty parameter - rightx");
String expectedLogMessage = getExpectedLogMessageEmptyCoords(student);
String expectedUrl = getPageResultDestination(Const.ActionURIs.STUDENT_PROFILE_PAGE, true, student.googleId);
submissionParams = createValidParamsForProfilePictureEdit();
submissionParams[3] = "";
StudentProfilePictureEditAction action = getAction(submissionParams);
RedirectResult result = getRedirectResult(action);
AssertHelper.assertLogMessageEquals(expectedLogMessage, action.getLogMessage());
assertEquals(expectedUrl, result.getDestinationWithParams());
}
Aggregations