Reputation: 7372
I have a method which inside calls another method.
This method has only one signature, for example:
Koko(ComplexType isKoko)
I want to verify that this method executed without checking the instance of the parameter and doing something like this:
It check_description = () => mockKoko.Verify(x => x.Koko(anything), Times.Once());
I searched the forum and Google and couldn't find an answer.
I'll appreciate any help.
Upvotes: 8
Views: 6943
Reputation: 179
mock.Verify(m => m.MethodToCheckIfCalled(It.Is<IUserDTO>(x => x.LastName == "3" & x.FirstName == "2")));
Upvotes: 5
Reputation: 7705
You can use It.IsAny<ComplexType>()
:
check_description = () => mockKoko.Verify(x => x.Koko(It.IsAny<ComplexType>()), Times.Once());
Upvotes: 7