I want my test to verify that there was no interaction with a dependency not just individual method or property. Is there a way to do that easily?
Found answer here: What is the FakeItEasy equivalent of the Moq VerifyNoOtherCalls() method
I want my test to verify that there was no interaction with a dependency not just individual method or property. Is there a way to do that easily?
Found answer here: What is the FakeItEasy equivalent of the Moq VerifyNoOtherCalls() method
With FakeItEasy you can create a strict mock for your dependency and not define any methods/properties.
var foo = A.Fake<IFoo>(x => x.Strict());
Any attempts to access foo
members will result in an ExpectationException
.
Gabriel's answer is fine. Another option, if you prefer to check explicitly, it this:
A.CallTo(theDependency).MustNotHaveHappened();