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?

有帮助吗?

解决方案

Dont use VerfiyAll() then. Just use Verify() on the calls you do care about.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top