protected override ValidationResult IsValid(object value, ValidationContext context)
        {
            var nationalIdentifier = value as string;

            if (_countryCode == null)
            {
                return(NationalIdentifierValidator.IsValidInAnyCountry(nationalIdentifier)
                    ? ValidationResult.Success
                    : new ValidationResult(ErrorMessages.GetInvalidIdentifierMessage(nationalIdentifier)));
            }

            var countryCode = (CountryCode)_countryCode;
            var validator   = NationalIdentifierValidator.GetValidator(countryCode);

            return(validator.IsValid(nationalIdentifier)
                ? ValidationResult.Success
                : new ValidationResult(
                       ErrorMessages.GetInvalidIdentifierMessage(nationalIdentifier, countryCode)));
        }
        public void IsValidInAnyCountry_InvalidNationalIdentifier_ReturnsFalse(string nationalIdentifier)
        {
            var result = NationalIdentifierValidator.IsValidInAnyCountry(nationalIdentifier);

            Assert.That(result, Is.False);
        }