Half the links I try off the Moq page are broken, including the one for their official API documentation. So I'll ask here.
I have successfully used a single "catch all" parameter like so:
mockRepo.Setup(r => r.GetById(It.IsAny<int>())).Returns((int i) => mockCollection.Where(x => x.Id == i).Single());
However I can't figure out how to achieve the same behavior with multiple parameters.
mockRepo.Setup(r => r.GetByABunchOfStuff(It.IsAny<int>(), It.IsAny<string>(), It.IsAny<int>())).Returns( ..... );
The ....
is the part I can't figure out.
Edit in response to Jordan:
The problem is how to represent the 3 parameters instead of just one.
How to turn:
(int i) => mockCollection.Where(x => x.Id == i)
into:
(int i), (string s), (int j) => mockCollection.Where(x => x.Id == i && x.SomeProp == s && x.SomeOtherProp == j)