Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added CallerArgumentExpression and tests for more methods #177

Merged
merged 1 commit into from
Jan 20, 2022
Merged

Added CallerArgumentExpression and tests for more methods #177

merged 1 commit into from
Jan 20, 2022

Conversation

stap123
Copy link
Contributor

@stap123 stap123 commented Jan 20, 2022

Following on from #149

I have added the attributes to a number of the other methods. There are some I have left out because they would require swapping parameter orders around and I wasn't sure how you wanted to proceed with those? The methods I skipped for this PR are:

GuardAgainstInvalidFormExtensions.cs

public static string InvalidFormat(...)
public static T InvalidInput<T>(...)

GuardAgainstOutOfRangeExtensions.cs

public static IEnumerable<T> OutOfRange<T>(...)
public static T OutOfRange<T>(...)

There are also a few places where I have added a ! to stop VS moaning about null references because they relate to the parameterName parameter which will be given a value by the compiler so they can't be null. If my understanding of this is wrong let me know and I'll make the changes I need to. These methods are:

GuardAgainstNotFoundExtensions.cs

public static T NotFound<T>(...)
public static T NotFound<TKey, T>(...)

GuardAgainstOutOfRangeExtensions.cs

public static DateTime OutOfSQLDateRange(...)

GuardAgainstZeroExtensions.cs

public static int Zero(...)
public static long Zero(...)
public static decimal Zero(...)
public static float Zero(...)
public static double Zero(...)
public static TimeSpan Zero(...)

@ardalis ardalis merged commit 9c271b7 into ardalis:main Jan 20, 2022
@ardalis
Copy link
Owner

ardalis commented Jan 20, 2022

Thanks!

@stap123 stap123 deleted the caller-argument branch January 20, 2022 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants