Skip to content

Unit tests for validation rules

Choose a tag to compare

@clicalmani clicalmani released this 15 Oct 22:15
· 4 commits to main since this release

Changes logs

  1. Add comprehensive validation tests for various rules
  2. Implemented NumberValidatorTest to validate numeric inputs, including valid and invalid cases, type checks, range validations, and formatting options.
  3. Created NumbersValidatorTest to handle arrays of numbers, delimited strings, JSON arrays, and various validation rules like min/max items and distinct values.
  4. Developed NumericValidatorTest for numeric inputs with specific formats, precision, and currency checks.
  5. Added PDFValidatorTest to validate PDF files, checking for structure, versioning, and content checks.
  6. Introduced PasswordValidatorTest to enforce password strength requirements, including length, character types, and common password checks.
  7. Established RegExpValidatorTest to validate strings against regular expressions with various options.
  8. Created StringValidatorTest to validate string inputs, including length, format, sanitization, and pattern matching.
  9. Implemented StringsValidatorTest for arrays of strings with similar validation rules as StringValidator.
  10. Added UrlValidatorTest to validate URLs, including scheme checks, domain restrictions, and parsing capabilities.
  11. Introduced TestCase class to provide a base for all tests, including setup and validator state management.
  12. Created ValidatorTest to validate the core functionality of the Validator class, including pattern parsing and integration with validation providers.