validation of length of the password and tests