Verifies all expectations regardless of whether they have
been flagged as verifiable.
Namespace:
MoqAssembly: Moq (in Moq.dll) Version: 2.5.1.153 (2.5.1.0)
Syntax
| C# |
|---|
void VerifyAll() |
Examples
This example sets up an expectation without marking it as verifiable. After
the mock is used, a VerifyAll()()() call is issued on the mock
to ensure that all expectations are met:
CopyC#
var mock = new Mock<IWarehouse>(); mock.Expect(x => x.HasInventory(TALISKER, 50)).Returns(true); ... // other test code ... // Will throw if the test code has didn't call HasInventory, even // that expectation was not marked as verifiable. mock.VerifyAll();
Exceptions
| Exception | Condition |
|---|---|
| Moq..::.MockException | At least one expectation was not met. |