سؤال

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