Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sergio-sastre/8374836469126f468de483722a587e15 to your computer and use it in GitHub Desktop.
Save sergio-sastre/8374836469126f468de483722a587e15 to your computer and use it in GitHub Desktop.
Multiplying the quality of your Unit Tests (Part2) with PBT - BrokenContainsUpperCaseLetterValidator
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