'MOQ - verify method with parameter executed regardless of the parameter used
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.
Solution 1:[1]
mock.Verify(m => m.MethodToCheckIfCalled(It.Is<IUserDTO>(x => x.LastName == "3" & x.FirstName == "2")));
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | pjpscriv |
