Moq/moq4 — pull request #27 by rdingwall (2012-09-12 21:40:10+00:00)
Title: Feature request: It.IsIn(..), It.IsNotIn(...)

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.

```csharp
// IEnumerable
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](http://code.google.com/p/moq/issues/detail?id=338) as a patch on Google code).