/// <summary> /// Throws <see cref="InvalidIcaoCodeException" />, if at least one element of <paramref name="icaoCodes" /> does not /// satisfy ICAO airport code requirements. /// </summary> /// <param name="icaoCodes">Collection of strings for performing airport ICAO code requirements check.</param> /// <exception cref="InvalidIcaoCodeException"> /// If at least one element of <paramref name="icaoCodes" /> does not satisfy ICAO airport code requirements. /// </exception> /// <exception cref="System.ArgumentNullException"> /// If <paramref name="icaoCodes" /> is <c>null</c>. /// </exception> public static void ThrowExceptionIfContainsInvalidIcaoCode([NotNull] IEnumerable <string> icaoCodes) { NullChecking.ThrowExceptionIfNull(icaoCodes, nameof(icaoCodes)); foreach (string code in icaoCodes) { ThrowExceptionIfIcaoCodeIsInvalid(code); } }
/// <summary> /// Throws <see cref="ArgumentException" /> if at least one element of <paramref name="collection" /> is not a valid /// string. /// Throws <see cref="ArgumentNullException" /> if <paramref name="collection" /> is <c>null</c>. /// </summary> /// <param name="collection">Collection of strings for performing string checking.</param> /// <param name="collectionName">Collection name (for more informative exception throw).</param> /// <exception cref="ArgumentException"> /// If at least one element of <paramref name="collection" /> is not a valid string. /// </exception> /// <exception cref="ArgumentNullException"> /// If <paramref name="collection" /> is <c>null</c>. /// </exception> public static void ThrowExceptionIfNullOrContainsInvalidString([NotNull] IEnumerable <string> collection, [NotNull] string collectionName) { NullChecking.ThrowExceptionIfNull(collection, collectionName); ThrowExceptionIfContainsInvalidString(collection, collectionName); }