Using Moq to generate Stub and Mocks in my unit tests, I have a case where I want to verify that a method is being called that takes a Delegate parameter. I don't care about the specific delegate setting. I just want to make sure that the method is actually called. The method is as follows:
public interface IInvokerProxy{ void Invoke(Delegate method); ... }
In my tests, I would like to do something like this:
invokerProxyMock.Verify( proxy => proxy.Invoke( It.IsAny<Delegate>));
This currently gives me an error. Argument "1": cannot convert from "method group" to "System.Delegate". Does anyone know if this is possible?
source share