Using Moq how do you verify function was called without specifying parameters?
Sometimes I want to just verify that a function was called rather than have to test the function was called with specific parameters.
The reason for this that there is a complex object being passed in as a parameter, but the later call inside that function makes a database fetch. Since this will be mocked, it will just have nulls & 0s.
I just wa开发者_如何学Cnt to verify the call without testing against the passed in parameters. How can I do this?
You may find the following blog post useful. Quote:
myMockedClass.Verify(
x => x.Connect(It.IsAny<MyArgumentType>())
);
精彩评论