Dont use VerfiyAll()
then. Just use Verify()
on the calls you do care about.
How do I exclude a method call from verification?
-
10-03-2022 - |
سؤال
I am using Moq and set up some expectations in the TestInitialize method as so:
[TestInitialize]
public void init()
{
mockRepo.Setup(x => x.EventDefinitions).Returns(ListsOfEvents.EventDefinitions);
mockRepo.Setup(x => x.EventTypes).Returns(ListsOfEvents.EventTypes);
}
I don't care if these are called or not so I don't want the VerifyAll()
to throw an exception for these.
What's the magic combination of letters I need to type?
المحلول
لا تنتمي إلى StackOverflow