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

Arg validation clean up #11893

Merged
merged 1 commit into from
May 8, 2020
Merged

Conversation

JoshLove-msft
Copy link
Member

Get rid of using the Track 1 Fx/ExceptionUtilities in favor of using Azure Core Argument methods. Also deleted a few other unused files.

@@ -79,7 +77,7 @@ public TimeSpan MaxAutoLockRenewalDuration
{
if (value.HasValue)
{
TimeoutHelper.ThrowIfNegativeArgument(value.Value, nameof(MaxReceiveWaitTime));
Argument.AssertPositive(value.Value, nameof(MaxReceiveWaitTime));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should actually be positive rather than just non-negative.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume the result of Argument.AssertNotNegative and Argument.AssertPositive will be the same, both will throw for negative value? if yes, then why do have 2 different methods?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AssertNotNegative allows >= 0
AssertPositive allows > 0

@@ -79,7 +77,7 @@ public TimeSpan MaxAutoLockRenewalDuration
{
if (value.HasValue)
{
TimeoutHelper.ThrowIfNegativeArgument(value.Value, nameof(MaxReceiveWaitTime));
Argument.AssertPositive(value.Value, nameof(MaxReceiveWaitTime));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume the result of Argument.AssertNotNegative and Argument.AssertPositive will be the same, both will throw for negative value? if yes, then why do have 2 different methods?

@ShivangiReja
Copy link
Member

@JoshLove-msft PR looks good to me. Thanks for cleaning this up.

@JoshLove-msft JoshLove-msft merged commit aca8fa2 into Azure:master May 8, 2020
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.

2 participants