I'm using Moq for unit tests, and I've set up an expectation like this:
myMock.Expect(w => w.MyMethod(It.IsAny<string>(),
It.IsAny<string>(),
It.IsAny<string>(),
It.IsAny<System.Exception>(), null))
.Returns(myResult);
the method it is mocking is:
logger.WriteLogItem(string1, string2, string3, System.Exception,
IEnumerableInstantiation);
This builds and runs fine, however VerifyAll() does not pass, and the error I get is:
Moq.MockVerificationException : The following expectations were not met:
IMyClass l => l.MyMethod(It.IsAny<string>(), It.IsAny<string>(),
It.IsAny<string>(), It.IsAny<String>(), null)
So it's changing the Exception to a string for some reason....
Has anyone seen this before/ have any idea why it's doing this and what I can do to fix it/work around it?
thanks!