public LoginConsistentValidation(Entities.Credential credential) { BaseValidation = new BaseValidation(); var usernameSpecification = new UsernameIsNotNullSpecification(); BaseValidation.AddSpecification("Username-Specification", usernameSpecification.IsSatisfyedBy(credential), "Username is null."); var passwordSpecification = new PasswordIsNotNullSpecification(); BaseValidation.AddSpecification("Password-Specification", passwordSpecification.IsSatisfyedBy(credential), "Password is null."); }
public bool IsSatisfyedBy(Entities.Credential entity) { return(!String.IsNullOrEmpty(entity.Password)); }
public bool IsSatisfyedBy(Entities.Credential entity) { return(!String.IsNullOrEmpty(entity.Username)); }