Class ProjectFormPanelTest
java.lang.Object
test.ProjectFormPanelTest
Unit tests for simple validation logic used by the project form.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidValidate that malformed dates are rejected.(package private) voidEnsure project names with invalid characters are rejected.(package private) voidEnsure overly long project descriptions are rejected.(package private) voidEnsure overly long project names are rejected.private booleanvalidateDate(String date) Validate date string uses yyyy-MM-dd and is not in the future.private booleanvalidateDescription(String description) Validate description length.private booleanvalidateProjectName(String name) Validate project name characters and length.
-
Constructor Details
-
ProjectFormPanelTest
public ProjectFormPanelTest()Public no-arg constructor for the test class.
-
-
Method Details
-
testInvalidDateFormat
@Test void testInvalidDateFormat()Validate that malformed dates are rejected. -
testSpecialCharactersInProjectName
@Test void testSpecialCharactersInProjectName()Ensure project names with invalid characters are rejected. -
testVeryLongProjectName
@Test void testVeryLongProjectName()Ensure overly long project names are rejected. -
testVeryLongDescription
@Test void testVeryLongDescription()Ensure overly long project descriptions are rejected. -
validateDate
Validate date string uses yyyy-MM-dd and is not in the future.- Parameters:
date- the date string to validate- Returns:
- true when valid
-
validateProjectName
Validate project name characters and length.- Parameters:
name- the project name- Returns:
- true when valid
-
validateDescription
Validate description length.- Parameters:
description- the project description- Returns:
- true when within acceptable length
-