I have a method on an interface:
string DoSomething(string whatever);
I want to mock this with MOQ, so that it returns whatever was passed
The generic Returns method can handle this situation nicely.
Returns
_mock.Setup(x => x.DoSomething(It.IsAny())).Returns(x => x);
Or if the method requires multiple inputs, specify them like so:
_mock.Setup(x => x.DoSomething(It.IsAny(), It.IsAny())).Returns((string x, int y) => x);