...

/

PassValidator: MultipleErrors Requirement

PassValidator: MultipleErrors Requirement

Implement the scenario in which there’s more than one validation error at the same time.

Before we implement the other features of the Validate function, let’s recap what we have managed until now:

  • We check if the password has at least eight characters.
  • We check if the password has at least two digits.

What if the password is shorter than eight characters and also has less than two digits? In this case, we should return both of the encountered validation errors, not just the first one ( ErrTooShort).

The MultipleErrors requirement

This feature should be able to manage a password like ...