Search in sources :

Example 1 with StudentProfilePictureEditAction

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

the class StudentProfilePictureEditActionTest method testActionForEmptyHeight.

private void testActionForEmptyHeight(AccountAttributes student) {
    ______TS("Failure case: empty parameter - height");
    String expectedLogMessage = getExpectedLogMessageEmptyDimensions(student);
    String expectedUrl = getPageResultDestination(Const.ActionURIs.STUDENT_PROFILE_PAGE, true, student.googleId);
    String[] submissionParams = createValidParamsForProfilePictureEdit();
    submissionParams[9] = "";
    StudentProfilePictureEditAction action = getAction(submissionParams);
    RedirectResult result = getRedirectResult(action);
    AssertHelper.assertLogMessageEquals(expectedLogMessage, action.getLogMessage());
    assertEquals(expectedUrl, result.getDestinationWithParams());
}
Also used : RedirectResult(teammates.ui.controller.RedirectResult) StudentProfilePictureEditAction(teammates.ui.controller.StudentProfilePictureEditAction)

Example 2 with StudentProfilePictureEditAction

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

the class StudentProfilePictureEditActionTest method testActionForZeroWidth.

private void testActionForZeroWidth(AccountAttributes student) {
    ______TS("Failure case: zero width");
    String expectedLogMessage = getExpectedLogMessageZeroDimensions(student);
    String expectedUrl = getPageResultDestination(Const.ActionURIs.STUDENT_PROFILE_PAGE, true, student.googleId);
    String[] submissionParams = createValidParamsForProfilePictureEdit();
    submissionParams[11] = "0";
    StudentProfilePictureEditAction action = getAction(submissionParams);
    RedirectResult result = getRedirectResult(action);
    AssertHelper.assertLogMessageEquals(expectedLogMessage, action.getLogMessage());
    assertEquals(expectedUrl, result.getDestinationWithParams());
}
Also used : RedirectResult(teammates.ui.controller.RedirectResult) StudentProfilePictureEditAction(teammates.ui.controller.StudentProfilePictureEditAction)

Example 3 with StudentProfilePictureEditAction

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

the class StudentProfilePictureEditActionTest method testActionForEmptyBottomY.

private void testActionForEmptyBottomY(AccountAttributes student) {
    ______TS("Failure case: empty parameter - bottomy");
    String expectedLogMessage = getExpectedLogMessageEmptyCoords(student);
    String expectedUrl = getPageResultDestination(Const.ActionURIs.STUDENT_PROFILE_PAGE, true, student.googleId);
    String[] submissionParams = createValidParamsForProfilePictureEdit();
    submissionParams[7] = "";
    StudentProfilePictureEditAction action = getAction(submissionParams);
    RedirectResult result = getRedirectResult(action);
    AssertHelper.assertLogMessageEquals(expectedLogMessage, action.getLogMessage());
    assertEquals(expectedUrl, result.getDestinationWithParams());
}
Also used : RedirectResult(teammates.ui.controller.RedirectResult) StudentProfilePictureEditAction(teammates.ui.controller.StudentProfilePictureEditAction)

Example 4 with StudentProfilePictureEditAction

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

the class StudentProfilePictureEditActionTest method testActionForEmptyWidth.

private void testActionForEmptyWidth(AccountAttributes student) {
    ______TS("Failure case: empty parameter - width");
    String expectedLogMessage = getExpectedLogMessageEmptyDimensions(student);
    String expectedUrl = getPageResultDestination(Const.ActionURIs.STUDENT_PROFILE_PAGE, true, student.googleId);
    String[] submissionParams = createValidParamsForProfilePictureEdit();
    submissionParams[11] = "";
    StudentProfilePictureEditAction action = getAction(submissionParams);
    RedirectResult result = getRedirectResult(action);
    AssertHelper.assertLogMessageEquals(expectedLogMessage, action.getLogMessage());
    assertEquals(expectedUrl, result.getDestinationWithParams());
}
Also used : RedirectResult(teammates.ui.controller.RedirectResult) StudentProfilePictureEditAction(teammates.ui.controller.StudentProfilePictureEditAction)

Example 5 with StudentProfilePictureEditAction

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

the class StudentProfilePictureEditActionTest method testActionForEmptyTopY.

private void testActionForEmptyTopY(AccountAttributes student) {
    ______TS("Failure case: empty parameter - topy");
    String expectedLogMessage = getExpectedLogMessageEmptyCoords(student);
    String expectedUrl = getPageResultDestination(Const.ActionURIs.STUDENT_PROFILE_PAGE, true, student.googleId);
    String[] submissionParams = createValidParamsForProfilePictureEdit();
    submissionParams[5] = "";
    StudentProfilePictureEditAction action = getAction(submissionParams);
    RedirectResult result = getRedirectResult(action);
    AssertHelper.assertLogMessageEquals(expectedLogMessage, action.getLogMessage());
    assertEquals(expectedUrl, result.getDestinationWithParams());
}
Also used : RedirectResult(teammates.ui.controller.RedirectResult) StudentProfilePictureEditAction(teammates.ui.controller.StudentProfilePictureEditAction)

Aggregations

RedirectResult (teammates.ui.controller.RedirectResult)9 StudentProfilePictureEditAction (teammates.ui.controller.StudentProfilePictureEditAction)9