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

Feature request: It.IsIn(..), It.IsNotIn(...) #27

Merged
merged 1 commit into from
Sep 13, 2012
Merged

Feature request: It.IsIn(..), It.IsNotIn(...) #27

merged 1 commit into from
Sep 13, 2012

Conversation

rdingwall
Copy link
Contributor

Hi, I would like to request a Rhino Mocks feature be ported to Moq that allows parameter matching from a collection when setting up calls.

// IEnumerable<TValue>
mock.Setup(x => x.Echo(It.IsIn(Enumerable.Range(1, 5)))).Returns(1);

// Variadic params
mock.Setup(x => x.Echo(It.IsIn(1, 2, 3, 4, 5))).Returns(1);

// As well as the inverses
mock.Setup(x => x.Echo(It.IsNotIn(Enumerable.Range(1, 5)))).Returns(1);
mock.Setup(x => x.Echo(It.IsNotIn(1, 2, 3, 4, 5))).Returns(1);

At work I have done this by hand more times than I can remember so I figured I may as well submit a patch and make it official!

Here it is as a pull request as requested (I originally raised it here as a patch on Google code).

kzu added a commit that referenced this pull request Sep 13, 2012
Feature request: It.IsIn(..), It.IsNotIn(...)
outstanding
Thanks for an outstanding quality contribution!
@kzu kzu merged commit 8d545d7 into devlooped:dev Sep 13, 2012
salfab added a commit to salfab/moq4 that referenced this pull request Apr 3, 2013
 - Rename ResetAllCalls method to a more suited "ResetCalls"
salfab added a commit to salfab/moq4 that referenced this pull request Apr 3, 2013
 - Rename ResetAllCalls method to a more suited "ResetCalls"
 - Rename MockExtensions to ObsoleteMockExtensions  << warning : this could introduce breaking changes
 - Rename MockResetExtensions  to MockExtensions
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