I have a method which I am testing. Given certain inputs, it should write a failure method to the logger (an ILogger). The interface has several overloads for Log(), as well as some properties (ex. a logging level). I am mocking the logger using FakeItEasy.
What I want to assert is that a call to Log() has happened. However, I don't care about which specific overload got used. How can I do this?
My ideas:
// Doesn't work, since a different overload (with more parameters) is used.
A.CallTo(() => mockLogger.Log(null)).WithAnyArguments().MustHaveHappened();
// "Works", but if the code were to call something else on the logger
// (ex. change the logging level), this would also pass!
Any.CallTo(mockLogger).MustHaveHappened();