I need to mock an interface to call to MSMQ, is there a way I can use Moq to simulate real MSMQ scenario that there are 10 messages in the queue, I call mocked function 10 t
You can also set up a separate function to do this. You can even pass the function a parameter if you want:
_serviceMock.Setup(x => x.SomeMethod(It.IsAny())).Returns((String param) => getTimesCalled(param));