diff --git a/src/test/java/PasswordGeneratorTest.java b/src/test/java/PasswordGeneratorTest.java index 8e35b3f..8c14fe6 100644 --- a/src/test/java/PasswordGeneratorTest.java +++ b/src/test/java/PasswordGeneratorTest.java @@ -15,16 +15,17 @@ class PasswordGeneratorTest { } @Test - void generateRandomPassword() { + void testGeneratedPasswordLength() { assertNotSame("", passwordGenerator.generateRandomPassword()); assertEquals(passwordGenerator.generateRandomPassword().length(), passwordGenerator.getLength()); - // test length requirement passwordGenerator.setLength(33); assertEquals(passwordGenerator.getLength(), 33); assertEquals(passwordGenerator.generateRandomPassword().length(), passwordGenerator.getLength()); + } - // test lowercase requirement + @Test + void testPasswordLowercaseRequirement() { assertTrue(Pattern.compile("^(?=.*[a-z]).+$").matcher(passwordGenerator.generateRandomPassword()).matches()); } }