How to make Moq ignore arguments that are ref or out
问题 In RhinoMocks, you can just tell your mocks to IgnoreArguments as a blanket statement. In Moq, it seems, you have to specify It.IsAny() for each argument. However, this doesn't work for ref and out arguments. How can I test the following method where I need to Moq the internal service call to return a specific result: public void MyMethod() { // DoStuff IList<SomeObject> errors = new List<SomeObject>(); var result = _service.DoSomething(ref errors, ref param1, param2); // Do more stuff } Test