Exemplo n.º 1
0
 /// <summary>
 /// Validates the IBAN according to the country specific definition.
 /// </summary>
 /// <param name="iban">The IBAN to validate.</param>
 /// <param name="definition">The country specific definition.</param>
 /// <returns>true if the IBAN is valid, or false otherwise</returns>
 protected override IbanValidationResult Validate(string iban, IbanRegionDefinition definition)
 {
     return(iban.Length == definition.Length
                         ? IbanValidationResult.Valid
                         : IbanValidationResult.InvalidLength);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Validates the IBAN according to the country specific definition.
 /// </summary>
 /// <param name="iban">The IBAN to validate.</param>
 /// <param name="definition">The country specific definition, or null if no definition was found.</param>
 /// <returns>true if the IBAN is valid, or false otherwise</returns>
 protected abstract IbanValidationResult Validate(string iban, IbanRegionDefinition definition);
Exemplo n.º 3
0
 /// <summary>
 /// Validates the IBAN according to the country specific definition.
 /// </summary>
 /// <param name="iban">The IBAN to validate.</param>
 /// <param name="definition">The country specific definition, or null if no definition was found.</param>
 /// <returns>true if the IBAN is valid, or false otherwise</returns>
 protected override IbanValidationResult Validate(string iban, IbanRegionDefinition definition)
 {
     return(definition == null
                         ? IbanValidationResult.UnknownCountryCode
                         : IbanValidationResult.Valid);
 }
Exemplo n.º 4
0
 /// <summary>
 /// Validates the IBAN according to the country specific definition.
 /// </summary>
 /// <param name="iban">The IBAN to validate.</param>
 /// <param name="definition">The country specific definition, or null if no definition was found.</param>
 /// <returns>true if the IBAN is valid, or false otherwise</returns>
 protected override IbanValidationResult Validate(string iban, IbanRegionDefinition definition)
 {
     return(definition.StructureTest.IsMatch(iban)
                         ? IbanValidationResult.Valid
                         : IbanValidationResult.InvalidStructure);
 }