What is the purpose of Verifiable() in Moq?

后端 未结 2 1453
隐瞒了意图╮
隐瞒了意图╮ 2020-11-30 01:03

What is the purpose of Verifiable()?

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

Edit:<

2条回答
  •  隐瞒了意图╮
    2020-11-30 01:26

    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.

提交回复
热议问题