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

            Assert.AreEqual(expectedValid, passportValid);
        }
Beispiel #2
0
        public static bool ValidatePassportStrict(Dictionary <string, string> parsedPassport)
        {
            bool passportIsValid = true;

            // First test with the simple Validator
            if (!PassportValidator.ValidatePassport(parsedPassport))
            {
                passportIsValid = false;
            }

            // Second, invalidate by Regex
            else if (!PassportValidator.ValidatePassportRegex(parsedPassport))
            {
                passportIsValid = false;
            }

            return(passportIsValid);
        }