Skip to content

Commit

Permalink
bugfix: added unit tests to password validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Troha7 committed Jan 6, 2024
1 parent 6d8468f commit ec4b6b6
Showing 1 changed file with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,24 @@ public void shouldFailValidator_whenUserInputPasswordWithSpace() {
@Test
public void shouldFailValidator_whenUserInputPasswordWithForbiddenSymbols() {
// Given
var password = "<Password!";
var password1 = "<Password!";
var password2 = "hjj;^33N";

// When
var isValid1 = passwordValidator.isValid(password1, context);
var isValid2 = passwordValidator.isValid(password2, context);

// Then
assertFalse(isValid1);
assertFalse(isValid2);
}

@DisplayName(
"PasswordValidator should fail validator when user input password with cyrillic letters")
@Test
public void shouldFailValidator_whenUserInputPasswordWithCyrillicLetters() {
// Given
var password = "Ася_77";

// When
var isValid = passwordValidator.isValid(password, context);
Expand Down

0 comments on commit ec4b6b6

Please sign in to comment.