I\'m tring to use a lambda with a multiple-params function but Moq throws this exception at runtime when I attempt to call the mock.Object.Convert(value, null, null, n
In my case, I thought that the type in Returns<>
is the output type, but in fact it was the input type(s).
So if you have a method
public virtual string Foo(int a, int b) { ... }
The correct clause is .Returns
, NOT .Returns
which is what I thought initially.
My mistake was because I was testing a function with the same input and return type initially - for example public virtual string Foo(string a)
.