diff --git a/Contracts/Synergy.Contracts.Test/Architecture/Public/Api.of.Synergy.Contracts.DotNet6_0.verified.md b/Contracts/Synergy.Contracts.Test/Architecture/Public/Api.of.Synergy.Contracts.DotNet6_0.verified.md index 1199419..d8ea850 100644 --- a/Contracts/Synergy.Contracts.Test/Architecture/Public/Api.of.Synergy.Contracts.DotNet6_0.verified.md +++ b/Contracts/Synergy.Contracts.Test/Architecture/Public/Api.of.Synergy.Contracts.DotNet6_0.verified.md @@ -211,7 +211,7 @@ - Fail.IfTooLongOrWhitespace( value: string [CanBeNull], maxLength: int, - name: string [NotNull, NotNull] + name: string? [Nullable, CallerArgumentExpression, Optional] ) : void [AssertionMethod] - Fail.IfTrue( value: bool [AssertionCondition], diff --git a/Contracts/Synergy.Contracts.Test/Architecture/Public/Api.of.Synergy.Contracts.DotNet7_0.verified.md b/Contracts/Synergy.Contracts.Test/Architecture/Public/Api.of.Synergy.Contracts.DotNet7_0.verified.md index 1199419..d8ea850 100644 --- a/Contracts/Synergy.Contracts.Test/Architecture/Public/Api.of.Synergy.Contracts.DotNet7_0.verified.md +++ b/Contracts/Synergy.Contracts.Test/Architecture/Public/Api.of.Synergy.Contracts.DotNet7_0.verified.md @@ -211,7 +211,7 @@ - Fail.IfTooLongOrWhitespace( value: string [CanBeNull], maxLength: int, - name: string [NotNull, NotNull] + name: string? [Nullable, CallerArgumentExpression, Optional] ) : void [AssertionMethod] - Fail.IfTrue( value: bool [AssertionCondition], diff --git a/Contracts/Synergy.Contracts.Test/Architecture/Public/Api.of.Synergy.Contracts.DotNet8_0.verified.md b/Contracts/Synergy.Contracts.Test/Architecture/Public/Api.of.Synergy.Contracts.DotNet8_0.verified.md index 1199419..d8ea850 100644 --- a/Contracts/Synergy.Contracts.Test/Architecture/Public/Api.of.Synergy.Contracts.DotNet8_0.verified.md +++ b/Contracts/Synergy.Contracts.Test/Architecture/Public/Api.of.Synergy.Contracts.DotNet8_0.verified.md @@ -211,7 +211,7 @@ - Fail.IfTooLongOrWhitespace( value: string [CanBeNull], maxLength: int, - name: string [NotNull, NotNull] + name: string? [Nullable, CallerArgumentExpression, Optional] ) : void [AssertionMethod] - Fail.IfTrue( value: bool [AssertionCondition], diff --git a/Contracts/Synergy.Contracts.Test/Failures/FailStringTest.cs b/Contracts/Synergy.Contracts.Test/Failures/FailStringTest.cs index 599dbda..edfae5a 100644 Binary files a/Contracts/Synergy.Contracts.Test/Failures/FailStringTest.cs and b/Contracts/Synergy.Contracts.Test/Failures/FailStringTest.cs differ diff --git a/Contracts/Synergy.Contracts/Failures/FailString.cs b/Contracts/Synergy.Contracts/Failures/FailString.cs index a748b47..773149e 100644 --- a/Contracts/Synergy.Contracts/Failures/FailString.cs +++ b/Contracts/Synergy.Contracts/Failures/FailString.cs @@ -232,7 +232,12 @@ string name public static void IfTooLongOrWhitespace( [CanBeNull] string value, int maxLength, - [NotNull] [System.Diagnostics.CodeAnalysis.NotNull] string name) +#if NET6_0_OR_GREATER + [System.Runtime.CompilerServices.CallerArgumentExpression("value")] string? name = null +#else + string name +#endif + ) { Fail.IfArgumentWhiteSpace(value, name); Fail.IfTooLong(value, maxLength, name);