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

Specify units in After(int delayInMilliseconds, int pollingInterval) #4704

Merged
merged 1 commit into from May 25, 2024

Conversation

RenderMichael
Copy link
Contributor

Although milliseconds is the natural unit for an int delay, specifying can still be helpful just to be sure.

Although milliseconds is the natural unit for an `int` delay, specifying can still be helpful just to be sure.
@@ -304,7 +304,7 @@ public DelayedConstraint.WithRawDelayInterval After(int delay)
/// and polling interval.
/// </summary>
/// <param name="delayInMilliseconds">The delay in milliseconds.</param>
/// <param name="pollingInterval">The interval at which to test the constraint.</param>
/// <param name="pollingInterval">The interval at which to test the constraint, in milliseconds.</param>
Copy link
Member

Choose a reason for hiding this comment

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

It would be more consistent to rename the parameter into pollingIntervalInMilliseconds to match the delay one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If that’s an acceptable break, I’ll make that change next time I’m in front of a keyboard

Copy link
Member

Choose a reason for hiding this comment

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

Previously I would have said yes, but thinking off it, if someone did .After(100, pollingInterval: 10) it would be a breaking change. So therefore all we can change is the comments.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If it’s valuable enough, this method can be obsoleted in favor of the enhanced syntax .After(100).Milliseconds.PollEvery(10).Milliseconds. It would be the perfect scenario for an analyzer and fixer.

Copy link
Member

@stevenaw stevenaw left a comment

Choose a reason for hiding this comment

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

Looks great to me, thanks for your contribution @RenderMichael !
I'll leave this unmerged for now to allow @manfred-brands the opportunity to review too as they had been involved in earlier discussions.

Copy link
Member

@manfred-brands manfred-brands left a comment

Choose a reason for hiding this comment

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

Approved.
Maybe we can add more type safe version in some other PR and then hide this in the next major release.

@manfred-brands manfred-brands merged commit 376b434 into nunit:master May 25, 2024
5 checks passed
@RenderMichael RenderMichael deleted the patch-1 branch May 25, 2024 02:02
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

3 participants