Created
July 18, 2021 10:02
-
-
Save sergio-sastre/1205b0a63572021875ef9b1e55eceaaf 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
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 | |
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