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
Not an answer for OP but perhaps for future googlers:
I had a Callback that didn't match the signature of the method being setup
Mock
.Setup(r => r.GetNextCustomerNumber(It.IsAny()))
.Returns(AccountCounter++)
.Callback(badStringParam, leadingDigit =>
{
// Doing stuff here, note that the 'GetNextCustomerNumber' signature is a single int
// but the callback unreasonably expects an additional string parameter.
});
This was the result of some refactoring and the refactoring tool of course couldn't realise that the Callback signature was incorrect