Skip to content

Commit 26434e9

Browse files
Lorenzo Solano MartinezLorenzo Solano Martinez
authored andcommitted
Removing build warnings
1 parent 1398d3d commit 26434e9

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

src/Validations/Arguments.cs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public static string NotEmptyOrException(
123123
public static Guid NotEmptyOrException(Guid value,
124124
[NotNull, CallerArgumentExpression(nameof(value))] string paramName = "")
125125
{
126-
string validParamName = paramName.CheckNotZeroLengthOrWhiteSpaceOnly();
126+
string validParamName = paramName.CheckParamName();
127127

128128
return IsEmpty(value) ? throw new ArgumentException(validParamName) : value;
129129
}
@@ -168,8 +168,8 @@ public static Guid NotEmptyOrExceptionWithMessage(Guid value,
168168
[NotNull, CallerArgumentExpression(nameof(value))] string paramName = "")
169169
{
170170
(string validParamName, string validCustomMessage) =
171-
(paramName.CheckNotZeroLengthOrWhiteSpaceOnly(),
172-
customMessage.CheckNotZeroLengthOrWhiteSpaceOnly());
171+
(paramName.CheckParamName(),
172+
customMessage.CheckExceptionMessage());
173173

174174
return IsEmpty(value) ?
175175
throw new ArgumentException(paramName: validParamName, message: validCustomMessage)
@@ -480,8 +480,8 @@ public static string ValidLuhnChecksum([NotNull] string? value, [NotNull] string
480480
[NotNull, CallerArgumentExpression(nameof(value))] string paramName = "")
481481
{
482482
(string validParamName, string validCustomMessage) =
483-
(paramName.CheckNotZeroLengthOrWhiteSpaceOnly(),
484-
customMessage.CheckNotZeroLengthOrWhiteSpaceOnly());
483+
(paramName.CheckParamName(),
484+
customMessage.CheckExceptionMessage());
485485

486486
string notNullValue = NullAndEmptyChecks.Check(value, validParamName);
487487

@@ -521,8 +521,7 @@ private static int[] ToDigitsArray(string notNullValue)
521521
[DebuggerStepThrough]
522522
public static string ValidBase64([NotNull] string? value, [NotNull, CallerArgumentExpression(nameof(value))] string paramName = "")
523523
{
524-
string validParamName =
525-
paramName.CheckNotZeroLengthOrWhiteSpaceOnly();
524+
string validParamName = paramName.CheckParamName();
526525

527526
string notNullValue = value.CheckNotZeroLengthOrWhiteSpaceOnly(validParamName);
528527

@@ -544,8 +543,8 @@ public static string ValidBase64([NotNull] string? value, [NotNull] string custo
544543
[NotNull, CallerArgumentExpression(nameof(value))] string paramName = "")
545544
{
546545
(string validParamName, string validCustomMessage) =
547-
(paramName.CheckNotZeroLengthOrWhiteSpaceOnly(),
548-
customMessage.CheckNotZeroLengthOrWhiteSpaceOnly());
546+
(paramName.CheckParamName(),
547+
customMessage.CheckExceptionMessage());
549548

550549
string notNullValue
551550
= value.ValueOrThrowIfNullZeroLengthOrWhiteSpaceOnly(validParamName, validCustomMessage);
@@ -609,9 +608,9 @@ private static TNullable CompliesWithExpected<TNullable>(
609608
{
610609
TNullable notNullValue = value.Check(nameof(value));
611610
Func<TNullable, bool> notNullValidator = validator.Check();
612-
string notNullParamName = paramName.CheckNotZeroLengthOrWhiteSpaceOnly();
611+
string notNullParamName = paramName.CheckParamName();
613612
string notNullPreconditionDescription
614-
= preconditionDescription.CheckNotZeroLengthOrWhiteSpaceOnly();
613+
= preconditionDescription.CheckExceptionMessage();
615614

616615
return notNullValidator(notNullValue) != expected
617616
? throw new ArgumentException(paramName: notNullParamName, message: notNullPreconditionDescription)

src/Validations/ArgumentsHelpers/Extensions.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ internal static string CheckNotWhiteSpaceOnly(this string value, string paramNam
5252

5353
[return: NotNull]
5454
internal static string CheckNotZeroLengthOrWhiteSpaceOnly(
55-
[NotNull] this string? value,
56-
[CallerArgumentExpression(nameof(value))] string paramName = "")
55+
[NotNull] this string? value, string paramName = "")
5756
=> Check(value, paramName)
5857
.CheckNotZeroLength(paramName)
5958
.CheckNotWhiteSpaceOnly(paramName);

0 commit comments

Comments
 (0)