Created
July 18, 2021 10:03
-
-
Save sergio-sastre/e0f7313e494bf453cc838162dfe62bac to your computer and use it in GitHub Desktop.
Multiplying the quality of your Unit Tests (Part2) with PBT - Jqwik Password Validator Property-Based Test with seed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Label("If password without upper case chars," + | |
"the error message contains 'no upper case letters'" | |
) | |
@Property(seed = "-7293214509268013126") | |
fun testPasswordValidatorRight(@ForAll("noUpperCase") password: String?) { | |
collectPasswordStats(password) | |
val actualError = passwordValidator.validate(password) | |
Truth.assertThat(actualError).contains("no upper case letters") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment