Created
July 18, 2021 09:49
-
-
Save sergio-sastre/8374836469126f468de483722a587e15 to your computer and use it in GitHub Desktop.
Multiplying the quality of your Unit Tests (Part2) with PBT - BrokenContainsUpperCaseLetterValidator
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
class ContainsUpperCaseLetterValidator : RequirementValidator { | |
override val keywordOnError: String? = "no upper case letters" | |
override fun isValid(password: String?): Boolean = | |
password?.contains("[a-z]".toRegex()) == true | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment