public void TestValidatePassportStrict(int iTestDataPassport, bool expectedValid)
        {
            string[] rawPassports = PassportValidator.GetInputData(FilePathTestDataStrict);
            Dictionary <string, string> parsedPassport = PassportValidator.ParseRawPassport(rawPassports[iTestDataPassport]);
            bool passportValid = PassportValidator.ValidatePassportStrict(parsedPassport);

            Assert.AreEqual(expectedValid, passportValid);
        }
Ejemplo n.º 2
0
        public static int CountValidPassportsStrict(string[] rawPassports)
        {
            int noOfValidPasswords = 0;

            foreach (string rawPassport in rawPassports)
            {
                Dictionary <string, string> parsedPassport = PassportValidator.ParseRawPassport(rawPassport);
                if (PassportValidator.ValidatePassportStrict(parsedPassport))
                {
                    noOfValidPasswords++;
                }
            }

            return(noOfValidPasswords);
        }