// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. // ===================== // Auto generated file // ===================== using System.Diagnostics.CodeAnalysis; namespace FisheryLib.Utility.Diagnostics; /// partial class Guard { /// partial class ThrowHelper { /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForIsEmpty(Span span, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(Span).ToTypeString()}) must be empty, had a size of {AssertString(span.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeEqualTo(Span span, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(Span).ToTypeString()}) must have a size equal to {size}, had a size of {AssertString(span.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeNotEqualTo(Span span, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(Span).ToTypeString()}) must have a size not equal to {size}, had a size of {AssertString(span.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeGreaterThan(Span span, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(Span).ToTypeString()}) must have a size over {size}, had a size of {AssertString(span.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeGreaterThanOrEqualTo(Span span, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(Span).ToTypeString()}) must have a size of at least {size}, had a size of {AssertString(span.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeLessThan(Span span, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(Span).ToTypeString()}) must have a size less than {size}, had a size of {AssertString(span.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeLessThanOrEqualTo(Span span, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(Span).ToTypeString()}) must have a size less than or equal to {size}, had a size of {AssertString(span.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeEqualTo(Span source, Span destination, string name) { throw new ArgumentException($"The source {AssertString(name)} ({typeof(Span).ToTypeString()}) must have a size equal to {AssertString(destination.Length)} (the destination), had a size of {AssertString(source.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeLessThanOrEqualTo(Span source, Span destination, string name) { throw new ArgumentException($"The source {AssertString(name)} ({typeof(Span).ToTypeString()}) must have a size less than or equal to {AssertString(destination.Length)} (the destination), had a size of {AssertString(source.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentOutOfRangeExceptionForIsInRangeFor(int index, Span span, string name) { throw new ArgumentOutOfRangeException(name, index, $"Parameter {AssertString(name)} (int) must be in the range given by <0> and {AssertString(span.Length)} to be a valid index for the target collection ({typeof(Span).ToTypeString()}), was {AssertString(index)}."); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentOutOfRangeExceptionForIsNotInRangeFor(int index, Span span, string name) { throw new ArgumentOutOfRangeException(name, index, $"Parameter {AssertString(name)} (int) must not be in the range given by <0> and {AssertString(span.Length)} to be an invalid index for the target collection ({typeof(Span).ToTypeString()}), was {AssertString(index)}."); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForIsEmpty(ReadOnlySpan span, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(ReadOnlySpan).ToTypeString()}) must be empty, had a size of {AssertString(span.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeEqualTo(ReadOnlySpan span, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(ReadOnlySpan).ToTypeString()}) must have a size equal to {size}, had a size of {AssertString(span.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeNotEqualTo(ReadOnlySpan span, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(ReadOnlySpan).ToTypeString()}) must have a size not equal to {size}, had a size of {AssertString(span.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeGreaterThan(ReadOnlySpan span, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(ReadOnlySpan).ToTypeString()}) must have a size over {size}, had a size of {AssertString(span.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeGreaterThanOrEqualTo(ReadOnlySpan span, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(ReadOnlySpan).ToTypeString()}) must have a size of at least {size}, had a size of {AssertString(span.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeLessThan(ReadOnlySpan span, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(ReadOnlySpan).ToTypeString()}) must have a size less than {size}, had a size of {AssertString(span.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeLessThanOrEqualTo(ReadOnlySpan span, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(ReadOnlySpan).ToTypeString()}) must have a size less than or equal to {size}, had a size of {AssertString(span.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeEqualTo(ReadOnlySpan source, Span destination, string name) { throw new ArgumentException($"The source {AssertString(name)} ({typeof(ReadOnlySpan).ToTypeString()}) must have a size equal to {AssertString(destination.Length)} (the destination), had a size of {AssertString(source.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeLessThanOrEqualTo(ReadOnlySpan source, Span destination, string name) { throw new ArgumentException($"The source {AssertString(name)} ({typeof(ReadOnlySpan).ToTypeString()}) must have a size less than or equal to {AssertString(destination.Length)} (the destination), had a size of {AssertString(source.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentOutOfRangeExceptionForIsInRangeFor(int index, ReadOnlySpan span, string name) { throw new ArgumentOutOfRangeException(name, index, $"Parameter {AssertString(name)} (int) must be in the range given by <0> and {AssertString(span.Length)} to be a valid index for the target collection ({typeof(ReadOnlySpan).ToTypeString()}), was {AssertString(index)}."); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentOutOfRangeExceptionForIsNotInRangeFor(int index, ReadOnlySpan span, string name) { throw new ArgumentOutOfRangeException(name, index, $"Parameter {AssertString(name)} (int) must not be in the range given by <0> and {AssertString(span.Length)} to be an invalid index for the target collection ({typeof(ReadOnlySpan).ToTypeString()}), was {AssertString(index)}."); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForIsEmpty(Memory memory, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(Memory).ToTypeString()}) must be empty, had a size of {AssertString(memory.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeEqualTo(Memory memory, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(Memory).ToTypeString()}) must have a size equal to {size}, had a size of {AssertString(memory.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeNotEqualTo(Memory memory, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(Memory).ToTypeString()}) must have a size not equal to {size}, had a size of {AssertString(memory.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeGreaterThan(Memory memory, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(Memory).ToTypeString()}) must have a size over {size}, had a size of {AssertString(memory.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeGreaterThanOrEqualTo(Memory memory, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(Memory).ToTypeString()}) must have a size of at least {size}, had a size of {AssertString(memory.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeLessThan(Memory memory, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(Memory).ToTypeString()}) must have a size less than {size}, had a size of {AssertString(memory.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeLessThanOrEqualTo(Memory memory, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(Memory).ToTypeString()}) must have a size less than or equal to {size}, had a size of {AssertString(memory.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeEqualTo(Memory source, Memory destination, string name) { throw new ArgumentException($"The source {AssertString(name)} ({typeof(Memory).ToTypeString()}) must have a size equal to {AssertString(destination.Length)} (the destination), had a size of {AssertString(source.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeLessThanOrEqualTo(Memory source, Memory destination, string name) { throw new ArgumentException($"The source {AssertString(name)} ({typeof(Memory).ToTypeString()}) must have a size less than or equal to {AssertString(destination.Length)} (the destination), had a size of {AssertString(source.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentOutOfRangeExceptionForIsInRangeFor(int index, Memory memory, string name) { throw new ArgumentOutOfRangeException(name, index, $"Parameter {AssertString(name)} (int) must be in the range given by <0> and {AssertString(memory.Length)} to be a valid index for the target collection ({typeof(Memory).ToTypeString()}), was {AssertString(index)}."); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentOutOfRangeExceptionForIsNotInRangeFor(int index, Memory memory, string name) { throw new ArgumentOutOfRangeException(name, index, $"Parameter {AssertString(name)} (int) must not be in the range given by <0> and {AssertString(memory.Length)} to be an invalid index for the target collection ({typeof(Memory).ToTypeString()}), was {AssertString(index)}."); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForIsEmpty(ReadOnlyMemory memory, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(ReadOnlyMemory).ToTypeString()}) must be empty, had a size of {AssertString(memory.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeEqualTo(ReadOnlyMemory memory, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(ReadOnlyMemory).ToTypeString()}) must have a size equal to {size}, had a size of {AssertString(memory.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeNotEqualTo(ReadOnlyMemory memory, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(ReadOnlyMemory).ToTypeString()}) must have a size not equal to {size}, had a size of {AssertString(memory.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeGreaterThan(ReadOnlyMemory memory, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(ReadOnlyMemory).ToTypeString()}) must have a size over {size}, had a size of {AssertString(memory.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeGreaterThanOrEqualTo(ReadOnlyMemory memory, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(ReadOnlyMemory).ToTypeString()}) must have a size of at least {size}, had a size of {AssertString(memory.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeLessThan(ReadOnlyMemory memory, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(ReadOnlyMemory).ToTypeString()}) must have a size less than {size}, had a size of {AssertString(memory.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeLessThanOrEqualTo(ReadOnlyMemory memory, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(ReadOnlyMemory).ToTypeString()}) must have a size less than or equal to {size}, had a size of {AssertString(memory.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeEqualTo(ReadOnlyMemory source, Memory destination, string name) { throw new ArgumentException($"The source {AssertString(name)} ({typeof(ReadOnlyMemory).ToTypeString()}) must have a size equal to {AssertString(destination.Length)} (the destination), had a size of {AssertString(source.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeLessThanOrEqualTo(ReadOnlyMemory source, Memory destination, string name) { throw new ArgumentException($"The source {AssertString(name)} ({typeof(ReadOnlyMemory).ToTypeString()}) must have a size less than or equal to {AssertString(destination.Length)} (the destination), had a size of {AssertString(source.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentOutOfRangeExceptionForIsInRangeFor(int index, ReadOnlyMemory memory, string name) { throw new ArgumentOutOfRangeException(name, index, $"Parameter {AssertString(name)} (int) must be in the range given by <0> and {AssertString(memory.Length)} to be a valid index for the target collection ({typeof(ReadOnlyMemory).ToTypeString()}), was {AssertString(index)}."); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentOutOfRangeExceptionForIsNotInRangeFor(int index, ReadOnlyMemory memory, string name) { throw new ArgumentOutOfRangeException(name, index, $"Parameter {AssertString(name)} (int) must not be in the range given by <0> and {AssertString(memory.Length)} to be an invalid index for the target collection ({typeof(ReadOnlyMemory).ToTypeString()}), was {AssertString(index)}."); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForIsEmpty(T[] array, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(T[]).ToTypeString()}) must be empty, had a size of {AssertString(array.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeEqualTo(T[] array, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(T[]).ToTypeString()}) must have a size equal to {size}, had a size of {AssertString(array.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeNotEqualTo(T[] array, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(T[]).ToTypeString()}) must have a size not equal to {size}, had a size of {AssertString(array.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeGreaterThan(T[] array, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(T[]).ToTypeString()}) must have a size over {size}, had a size of {AssertString(array.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeGreaterThanOrEqualTo(T[] array, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(T[]).ToTypeString()}) must have a size of at least {size}, had a size of {AssertString(array.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeLessThan(T[] array, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(T[]).ToTypeString()}) must have a size less than {size}, had a size of {AssertString(array.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeLessThanOrEqualTo(T[] array, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(T[]).ToTypeString()}) must have a size less than or equal to {size}, had a size of {AssertString(array.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeEqualTo(T[] source, T[] destination, string name) { throw new ArgumentException($"The source {AssertString(name)} ({typeof(T[]).ToTypeString()}) must have a size equal to {AssertString(destination.Length)} (the destination), had a size of {AssertString(source.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeLessThanOrEqualTo(T[] source, T[] destination, string name) { throw new ArgumentException($"The source {AssertString(name)} ({typeof(T[]).ToTypeString()}) must have a size less than or equal to {AssertString(destination.Length)} (the destination), had a size of {AssertString(source.Length)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentOutOfRangeExceptionForIsInRangeFor(int index, T[] array, string name) { throw new ArgumentOutOfRangeException(name, index, $"Parameter {AssertString(name)} (int) must be in the range given by <0> and {AssertString(array.Length)} to be a valid index for the target collection ({typeof(T[]).ToTypeString()}), was {AssertString(index)}."); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentOutOfRangeExceptionForIsNotInRangeFor(int index, T[] array, string name) { throw new ArgumentOutOfRangeException(name, index, $"Parameter {AssertString(name)} (int) must not be in the range given by <0> and {AssertString(array.Length)} to be an invalid index for the target collection ({typeof(T[]).ToTypeString()}), was {AssertString(index)}."); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForIsEmpty(List list, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(List).ToTypeString()}) must be empty, had a size of {AssertString(list.Count)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeEqualTo(List list, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(List).ToTypeString()}) must have a size equal to {size}, had a size of {AssertString(list.Count)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeNotEqualTo(List list, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(List).ToTypeString()}) must have a size not equal to {size}, had a size of {AssertString(list.Count)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeGreaterThan(List list, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(List).ToTypeString()}) must have a size over {size}, had a size of {AssertString(list.Count)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeGreaterThanOrEqualTo(List list, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(List).ToTypeString()}) must have a size of at least {size}, had a size of {AssertString(list.Count)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeLessThan(List list, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(List).ToTypeString()}) must have a size less than {size}, had a size of {AssertString(list.Count)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeLessThanOrEqualTo(List list, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(List).ToTypeString()}) must have a size less than or equal to {size}, had a size of {AssertString(list.Count)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeEqualTo(List source, List destination, string name) { throw new ArgumentException($"The source {AssertString(name)} ({typeof(List).ToTypeString()}) must have a size equal to {AssertString(destination.Count)} (the destination), had a size of {AssertString(source.Count)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeLessThanOrEqualTo(List source, List destination, string name) { throw new ArgumentException($"The source {AssertString(name)} ({typeof(List).ToTypeString()}) must have a size less than or equal to {AssertString(destination.Count)} (the destination), had a size of {AssertString(source.Count)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentOutOfRangeExceptionForIsInRangeFor(int index, List list, string name) { throw new ArgumentOutOfRangeException(name, index, $"Parameter {AssertString(name)} (int) must be in the range given by <0> and {AssertString(list.Count)} to be a valid index for the target collection ({typeof(List).ToTypeString()}), was {AssertString(index)}."); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentOutOfRangeExceptionForIsNotInRangeFor(int index, List list, string name) { throw new ArgumentOutOfRangeException(name, index, $"Parameter {AssertString(name)} (int) must not be in the range given by <0> and {AssertString(list.Count)} to be an invalid index for the target collection ({typeof(List).ToTypeString()}), was {AssertString(index)}."); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForIsEmpty(ICollection collection, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(ICollection).ToTypeString()}) must be empty, had a size of {AssertString(collection.Count)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeEqualTo(ICollection collection, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(ICollection).ToTypeString()}) must have a size equal to {size}, had a size of {AssertString(collection.Count)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeNotEqualTo(ICollection collection, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(ICollection).ToTypeString()}) must have a size not equal to {size}, had a size of {AssertString(collection.Count)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeGreaterThan(ICollection collection, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(ICollection).ToTypeString()}) must have a size over {size}, had a size of {AssertString(collection.Count)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeGreaterThanOrEqualTo(ICollection collection, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(ICollection).ToTypeString()}) must have a size of at least {size}, had a size of {AssertString(collection.Count)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeLessThan(ICollection collection, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(ICollection).ToTypeString()}) must have a size less than {size}, had a size of {AssertString(collection.Count)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeLessThanOrEqualTo(ICollection collection, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(ICollection).ToTypeString()}) must have a size less than or equal to {size}, had a size of {AssertString(collection.Count)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeEqualTo(ICollection source, ICollection destination, string name) { throw new ArgumentException($"The source {AssertString(name)} ({typeof(ICollection).ToTypeString()}) must have a size equal to {AssertString(destination.Count)} (the destination), had a size of {AssertString(source.Count)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeLessThanOrEqualTo(ICollection source, ICollection destination, string name) { throw new ArgumentException($"The source {AssertString(name)} ({typeof(ICollection).ToTypeString()}) must have a size less than or equal to {AssertString(destination.Count)} (the destination), had a size of {AssertString(source.Count)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentOutOfRangeExceptionForIsInRangeFor(int index, ICollection collection, string name) { throw new ArgumentOutOfRangeException(name, index, $"Parameter {AssertString(name)} (int) must be in the range given by <0> and {AssertString(collection.Count)} to be a valid index for the target collection ({typeof(ICollection).ToTypeString()}), was {AssertString(index)}."); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentOutOfRangeExceptionForIsNotInRangeFor(int index, ICollection collection, string name) { throw new ArgumentOutOfRangeException(name, index, $"Parameter {AssertString(name)} (int) must not be in the range given by <0> and {AssertString(collection.Count)} to be an invalid index for the target collection ({typeof(ICollection).ToTypeString()}), was {AssertString(index)}."); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForIsEmpty(IReadOnlyCollection collection, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(IReadOnlyCollection).ToTypeString()}) must be empty, had a size of {AssertString(collection.Count)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeEqualTo(IReadOnlyCollection collection, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(IReadOnlyCollection).ToTypeString()}) must have a size equal to {size}, had a size of {AssertString(collection.Count)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeNotEqualTo(IReadOnlyCollection collection, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(IReadOnlyCollection).ToTypeString()}) must have a size not equal to {size}, had a size of {AssertString(collection.Count)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeGreaterThan(IReadOnlyCollection collection, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(IReadOnlyCollection).ToTypeString()}) must have a size over {size}, had a size of {AssertString(collection.Count)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeGreaterThanOrEqualTo(IReadOnlyCollection collection, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(IReadOnlyCollection).ToTypeString()}) must have a size of at least {size}, had a size of {AssertString(collection.Count)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeLessThan(IReadOnlyCollection collection, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(IReadOnlyCollection).ToTypeString()}) must have a size less than {size}, had a size of {AssertString(collection.Count)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeLessThanOrEqualTo(IReadOnlyCollection collection, int size, string name) { throw new ArgumentException($"Parameter {AssertString(name)} ({typeof(IReadOnlyCollection).ToTypeString()}) must have a size less than or equal to {size}, had a size of {AssertString(collection.Count)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeEqualTo(IReadOnlyCollection source, ICollection destination, string name) { throw new ArgumentException($"The source {AssertString(name)} ({typeof(IReadOnlyCollection).ToTypeString()}) must have a size equal to {AssertString(destination.Count)} (the destination), had a size of {AssertString(source.Count)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentExceptionForHasSizeLessThanOrEqualTo(IReadOnlyCollection source, ICollection destination, string name) { throw new ArgumentException($"The source {AssertString(name)} ({typeof(IReadOnlyCollection).ToTypeString()}) must have a size less than or equal to {AssertString(destination.Count)} (the destination), had a size of {AssertString(source.Count)}.", name); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentOutOfRangeExceptionForIsInRangeFor(int index, IReadOnlyCollection collection, string name) { throw new ArgumentOutOfRangeException(name, index, $"Parameter {AssertString(name)} (int) must be in the range given by <0> and {AssertString(collection.Count)} to be a valid index for the target collection ({typeof(IReadOnlyCollection).ToTypeString()}), was {AssertString(index)}."); } /// /// Throws an when (or an overload) fails. /// [DoesNotReturn] public static void ThrowArgumentOutOfRangeExceptionForIsNotInRangeFor(int index, IReadOnlyCollection collection, string name) { throw new ArgumentOutOfRangeException(name, index, $"Parameter {AssertString(name)} (int) must not be in the range given by <0> and {AssertString(collection.Count)} to be an invalid index for the target collection ({typeof(IReadOnlyCollection).ToTypeString()}), was {AssertString(index)}."); } } }