Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
502 changes: 502 additions & 0 deletions Microsoft.Toolkit/Diagnostics/Generated/Guard.Comparable.Numeric.g.cs

Large diffs are not rendered by default.

63 changes: 32 additions & 31 deletions Microsoft.Toolkit/Diagnostics/Generated/Guard.Comparable.Numeric.tt
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ namespace Microsoft.Toolkit.Diagnostics
public static partial class Guard
{
<#
GenerateTextForItems(NumericTypes, type =>
GenerateTextForItems(NumericTypes, typeInfo =>
{
var (type, prefix) = typeInfo;
#>
/// <summary>
/// Asserts that the input value must be equal to a specified value.
/// </summary>
/// <param name="value">The input <see cref="<#=type#>"/> value to test.</param>
/// <param name="target">The target <see cref="<#=type#>"/> value to test for.</param>
/// <param name="value">The input <see <#=prefix#>="<#=type#>"/> value to test.</param>
/// <param name="target">The target <see <#=prefix#>="<#=type#>"/> value to test for.</param>
/// <param name="name">The name of the input parameter being tested.</param>
/// <exception cref="ArgumentException">Thrown if <paramref name="value"/> is != <paramref name="target"/>.</exception>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
Expand All @@ -37,8 +38,8 @@ GenerateTextForItems(NumericTypes, type =>
/// <summary>
/// Asserts that the input value must be not equal to a specified value.
/// </summary>
/// <param name="value">The input <see cref="<#=type#>"/> value to test.</param>
/// <param name="target">The target <see cref="<#=type#>"/> value to test for.</param>
/// <param name="value">The input <see <#=prefix#>="<#=type#>"/> value to test.</param>
/// <param name="target">The target <see <#=prefix#>="<#=type#>"/> value to test for.</param>
/// <param name="name">The name of the input parameter being tested.</param>
/// <exception cref="ArgumentException">Thrown if <paramref name="value"/> is == <paramref name="target"/>.</exception>
/// <remarks>The method is generic to avoid boxing the parameters, if they are value types.</remarks>
Expand All @@ -56,8 +57,8 @@ GenerateTextForItems(NumericTypes, type =>
/// <summary>
/// Asserts that the input value must be less than a specified value.
/// </summary>
/// <param name="value">The input <see cref="<#=type#>"/> value to test.</param>
/// <param name="maximum">The exclusive maximum <see cref="<#=type#>"/> value that is accepted.</param>
/// <param name="value">The input <see <#=prefix#>="<#=type#>"/> value to test.</param>
/// <param name="maximum">The exclusive maximum <see <#=prefix#>="<#=type#>"/> value that is accepted.</param>
/// <param name="name">The name of the input parameter being tested.</param>
/// <exception cref="ArgumentOutOfRangeException">Thrown if <paramref name="value"/> is >= <paramref name="maximum"/>.</exception>
/// <remarks>The method is generic to avoid boxing the parameters, if they are value types.</remarks>
Expand All @@ -75,8 +76,8 @@ GenerateTextForItems(NumericTypes, type =>
/// <summary>
/// Asserts that the input value must be less than or equal to a specified value.
/// </summary>
/// <param name="value">The input <see cref="<#=type#>"/> value to test.</param>
/// <param name="maximum">The inclusive maximum <see cref="<#=type#>"/> value that is accepted.</param>
/// <param name="value">The input <see <#=prefix#>="<#=type#>"/> value to test.</param>
/// <param name="maximum">The inclusive maximum <see <#=prefix#>="<#=type#>"/> value that is accepted.</param>
/// <param name="name">The name of the input parameter being tested.</param>
/// <exception cref="ArgumentOutOfRangeException">Thrown if <paramref name="value"/> is > <paramref name="maximum"/>.</exception>
/// <remarks>The method is generic to avoid boxing the parameters, if they are value types.</remarks>
Expand All @@ -94,8 +95,8 @@ GenerateTextForItems(NumericTypes, type =>
/// <summary>
/// Asserts that the input value must be greater than a specified value.
/// </summary>
/// <param name="value">The input <see cref="<#=type#>"/> value to test.</param>
/// <param name="minimum">The exclusive minimum <see cref="<#=type#>"/> value that is accepted.</param>
/// <param name="value">The input <see <#=prefix#>="<#=type#>"/> value to test.</param>
/// <param name="minimum">The exclusive minimum <see <#=prefix#>="<#=type#>"/> value that is accepted.</param>
/// <param name="name">The name of the input parameter being tested.</param>
/// <exception cref="ArgumentOutOfRangeException">Thrown if <paramref name="value"/> is &lt;= <paramref name="minimum"/>.</exception>
/// <remarks>The method is generic to avoid boxing the parameters, if they are value types.</remarks>
Expand All @@ -113,8 +114,8 @@ GenerateTextForItems(NumericTypes, type =>
/// <summary>
/// Asserts that the input value must be greater than or equal to a specified value.
/// </summary>
/// <param name="value">The input <see cref="<#=type#>"/> value to test.</param>
/// <param name="minimum">The inclusive minimum <see cref="<#=type#>"/> value that is accepted.</param>
/// <param name="value">The input <see <#=prefix#>="<#=type#>"/> value to test.</param>
/// <param name="minimum">The inclusive minimum <see <#=prefix#>="<#=type#>"/> value that is accepted.</param>
/// <param name="name">The name of the input parameter being tested.</param>
/// <exception cref="ArgumentOutOfRangeException">Thrown if <paramref name="value"/> is &lt; <paramref name="minimum"/>.</exception>
/// <remarks>The method is generic to avoid boxing the parameters, if they are value types.</remarks>
Expand All @@ -132,9 +133,9 @@ GenerateTextForItems(NumericTypes, type =>
/// <summary>
/// Asserts that the input value must be in a given range.
/// </summary>
/// <param name="value">The input <see cref="<#=type#>"/> value to test.</param>
/// <param name="minimum">The inclusive minimum <see cref="<#=type#>"/> value that is accepted.</param>
/// <param name="maximum">The exclusive maximum <see cref="<#=type#>"/> value that is accepted.</param>
/// <param name="value">The input <see <#=prefix#>="<#=type#>"/> value to test.</param>
/// <param name="minimum">The inclusive minimum <see <#=prefix#>="<#=type#>"/> value that is accepted.</param>
/// <param name="maximum">The exclusive maximum <see <#=prefix#>="<#=type#>"/> value that is accepted.</param>
/// <param name="name">The name of the input parameter being tested.</param>
/// <exception cref="ArgumentOutOfRangeException">Thrown if <paramref name="value"/> is &lt; <paramref name="minimum"/> or >= <paramref name="maximum"/>.</exception>
/// <remarks>
Expand All @@ -155,9 +156,9 @@ GenerateTextForItems(NumericTypes, type =>
/// <summary>
/// Asserts that the input value must not be in a given range.
/// </summary>
/// <param name="value">The input <see cref="<#=type#>"/> value to test.</param>
/// <param name="minimum">The inclusive minimum <see cref="<#=type#>"/> value that is accepted.</param>
/// <param name="maximum">The exclusive maximum <see cref="<#=type#>"/> value that is accepted.</param>
/// <param name="value">The input <see <#=prefix#>="<#=type#>"/> value to test.</param>
/// <param name="minimum">The inclusive minimum <see <#=prefix#>="<#=type#>"/> value that is accepted.</param>
/// <param name="maximum">The exclusive maximum <see <#=prefix#>="<#=type#>"/> value that is accepted.</param>
/// <param name="name">The name of the input parameter being tested.</param>
/// <exception cref="ArgumentOutOfRangeException">Thrown if <paramref name="value"/> is >= <paramref name="minimum"/> or &lt; <paramref name="maximum"/>.</exception>
/// <remarks>
Expand All @@ -178,9 +179,9 @@ GenerateTextForItems(NumericTypes, type =>
/// <summary>
/// Asserts that the input value must be in a given interval.
/// </summary>
/// <param name="value">The input <see cref="<#=type#>"/> value to test.</param>
/// <param name="minimum">The exclusive minimum <see cref="<#=type#>"/> value that is accepted.</param>
/// <param name="maximum">The exclusive maximum <see cref="<#=type#>"/> value that is accepted.</param>
/// <param name="value">The input <see <#=prefix#>="<#=type#>"/> value to test.</param>
/// <param name="minimum">The exclusive minimum <see <#=prefix#>="<#=type#>"/> value that is accepted.</param>
/// <param name="maximum">The exclusive maximum <see <#=prefix#>="<#=type#>"/> value that is accepted.</param>
/// <param name="name">The name of the input parameter being tested.</param>
/// <exception cref="ArgumentOutOfRangeException">Thrown if <paramref name="value"/> is &lt;= <paramref name="minimum"/> or >= <paramref name="maximum"/>.</exception>
/// <remarks>
Expand All @@ -201,9 +202,9 @@ GenerateTextForItems(NumericTypes, type =>
/// <summary>
/// Asserts that the input value must not be in a given interval.
/// </summary>
/// <param name="value">The input <see cref="<#=type#>"/> value to test.</param>
/// <param name="minimum">The exclusive minimum <see cref="<#=type#>"/> value that is accepted.</param>
/// <param name="maximum">The exclusive maximum <see cref="<#=type#>"/> value that is accepted.</param>
/// <param name="value">The input <see <#=prefix#>="<#=type#>"/> value to test.</param>
/// <param name="minimum">The exclusive minimum <see <#=prefix#>="<#=type#>"/> value that is accepted.</param>
/// <param name="maximum">The exclusive maximum <see <#=prefix#>="<#=type#>"/> value that is accepted.</param>
/// <param name="name">The name of the input parameter being tested.</param>
/// <exception cref="ArgumentOutOfRangeException">Thrown if <paramref name="value"/> is > <paramref name="minimum"/> or &lt; <paramref name="maximum"/>.</exception>
/// <remarks>
Expand All @@ -224,9 +225,9 @@ GenerateTextForItems(NumericTypes, type =>
/// <summary>
/// Asserts that the input value must be in a given interval.
/// </summary>
/// <param name="value">The input <see cref="<#=type#>"/> value to test.</param>
/// <param name="minimum">The inclusive minimum <see cref="<#=type#>"/> value that is accepted.</param>
/// <param name="maximum">The inclusive maximum <see cref="<#=type#>"/> value that is accepted.</param>
/// <param name="value">The input <see <#=prefix#>="<#=type#>"/> value to test.</param>
/// <param name="minimum">The inclusive minimum <see <#=prefix#>="<#=type#>"/> value that is accepted.</param>
/// <param name="maximum">The inclusive maximum <see <#=prefix#>="<#=type#>"/> value that is accepted.</param>
/// <param name="name">The name of the input parameter being tested.</param>
/// <exception cref="ArgumentOutOfRangeException">Thrown if <paramref name="value"/> is &lt; <paramref name="minimum"/> or > <paramref name="maximum"/>.</exception>
/// <remarks>
Expand All @@ -247,9 +248,9 @@ GenerateTextForItems(NumericTypes, type =>
/// <summary>
/// Asserts that the input value must not be in a given interval.
/// </summary>
/// <param name="value">The input <see cref="<#=type#>"/> value to test.</param>
/// <param name="minimum">The inclusive minimum <see cref="<#=type#>"/> value that is accepted.</param>
/// <param name="maximum">The inclusive maximum <see cref="<#=type#>"/> value that is accepted.</param>
/// <param name="value">The input <see <#=prefix#>="<#=type#>"/> value to test.</param>
/// <param name="minimum">The inclusive minimum <see <#=prefix#>="<#=type#>"/> value that is accepted.</param>
/// <param name="maximum">The inclusive maximum <see <#=prefix#>="<#=type#>"/> value that is accepted.</param>
/// <param name="name">The name of the input parameter being tested.</param>
/// <exception cref="ArgumentOutOfRangeException">Thrown if <paramref name="value"/> is >= <paramref name="minimum"/> or &lt;= <paramref name="maximum"/>.</exception>
/// <remarks>
Expand Down
Loading