Incorrect error message for WasCalledWithExactArguments when not called.
Here's the production code:
public class DoSendEmail
{
public void SendEmail()
{
return;
}
}
Here's the test code
[Test, Isolated]
public void DoubleTake()
{
SmtpClient smtpFake = Isolate.Fake.Instance<SmtpClient>(Members.ReturnRecursiveFakes);
Isolate.Swap.NextInstance<SmtpClient>().With(smtpFake);
MailMessage mailMessage = Isolate.Fake.Instance<MailMessage>(Members.CallOriginal);
DoSendEmail op = new DoSendEmail();
op.SendEmail();
Isolate.Verify.WasCalledWithExactArguments(() => smtpFake.Send(mailMessage));
}
And here's the error message:
failed: TypeMock.VerifyException :
TypeMock Verification: Method System.Net.Mail.SmtpClient.Send() was expected but was not called
at e0.b(ag A_0, b8 A_1)
at e0.e(Delegate A_0)
at e0.c(Action A_0)
It should be
smtpFake.Send(mailMessage), not
SmtpClient.Send()
________
Ffm video