What is the purpose of Verifiable() in Moq?

Viewed 54819

What is the purpose of Verifiable()?

If I verify a Mock and leave this out it still verifies the SetUp.

Edit: I was using VerifyAll() thus the reason for everything being verified. After changing to Verify() only my .Verifiable() SetUps were being checked.

2 Answers

When the Verify() method is called at the end of the test, if any of the expectations marked as verifiable have not been called, then an exception is thrown.

VerifyAll() does not check for verifiable expectations.

Related