private bool PassportHasAllRequiredFields(Passport passport) { var fields = passport.GetFields(); // check if every required fields exists in the fields foreach (var fieldKey in _requiredFieldKeys) { if (!fields.ContainsKey(fieldKey)) { return(false);; } } return(true); }
private bool PassportValidates(Passport passport) { var fields = passport.GetFields(); foreach (var field in fields) { bool fieldIsValid = FieldIsValid(field.Key, field.Value); if (!fieldIsValid) { return(false); } } return(true); }