Esempio n. 1
0
 internal bool IsValid()
 {
     return(PassportValidator.SimpleValidate(this) &&
            PassportValidator.ValidateBYR(Extract("byr")) &&
            PassportValidator.ValidateIYR(Extract("iyr")) &&
            PassportValidator.ValidateEYR(Extract("eyr")) &&
            PassportValidator.ValidateHeight(Extract("hgt")) &&
            PassportValidator.ValidateHairColor(Extract("hcl")) &&
            PassportValidator.ValidatePattern(Extract("ecl"), "^(amb|blu|brn|gry|grn|hzl|oth)$") &&
            PassportValidator.ValidatePattern(Extract("pid"), @"\d{9}"));
 }
Esempio n. 2
0
        public void ValidIssueYear(string input, bool expected)
        {
            bool result = PassportValidator.ValidateIYR(input);

            result.Should().Be(expected);
        }