static void Main(string[] args) { var passportData = GetPassportData(); var numberOfValidPassports = PassportValidator.Validate(passportData); Console.WriteLine("Number of valid passports found: {0}", numberOfValidPassports); }
static void Main(string[] args) { var input = File.ReadAllText("input.txt"); var passports = new PassportParser().ParsePassports(input); var passportValidatorPart1 = new PassportValidator(new [] { new RequriedFieldsValidation() }); Console.WriteLine(passportValidatorPart1.CountValid(passports)); var passportValidatorPart2 = new PassportValidator(new IPassportValidation[] { new RequriedFieldsValidation(), new ValidValueValidation() }); Console.WriteLine(passportValidatorPart2.CountValid(passports)); }