예제 #1
0
 public bool Validate(PasswordProperty property)
 {
     try
     {
         if (hasDigits(property.GetPassword))
         {
             return(nextValidator != null?nextValidator.Validate(property) : true);
         }
         else
         {
             property.AddErrors("Password requires digit.");
             return(false);
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
예제 #2
0
 public bool Validate(PasswordProperty property)
 {
     try
     {
         if (hasLowerCase(property.GetPassword))
         {
             return(nextValidator != null?nextValidator.Validate(property) : true);
         }
         else
         {
             property.AddErrors("Password must have lower case letter.");
             return(false);
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
예제 #3
0
 public bool Validate(PasswordProperty property)
 {
     try
     {
         if (hasrequiredLength(property))
         {
             return(nextValidator != null?nextValidator.Validate(property) : true);
         }
         else
         {
             property.AddErrors(string.Format("Password must have required length of {0}", property.RequiredLength));
             return(false);
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
예제 #4
0
 public bool Validate(PasswordProperty property)
 {
     try
     {
         if (hasNonLetterOrDigit(property.GetPassword))
         {
             return(nextValidator != null?nextValidator.Validate(property) : true);
         }
         else
         {
             property.AddErrors("Password must have a non letter or digit.");
             return(false);
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
예제 #5
0
 public bool Validate(PasswordProperty property)
 {
     try
     {
         if (!string.IsNullOrWhiteSpace(property.GetPassword))
         {
             return(nextValidator != null?nextValidator.Validate(property) : true);
         }
         else
         {
             property.AddErrors("Password is required.");
             return(false);
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
예제 #6
0
 public bool hasrequiredLength(PasswordProperty passwordItem)
 {
     return(passwordItem.GetPassword.Length > passwordItem.RequiredLength);
 }