Verifies that a property was set on the mock.
Namespace:
MoqAssembly: Moq (in Moq.dll) Version: 4.0.812.4 (4.0.0.0)
Syntax
| C# |
|---|
public void VerifySet( Action<T> setterExpression ) |
Parameters
- setterExpression
- Type: Action<(Of <(T>)>)
Expression to verify.
Examples
This example assumes that the mock has been used,
and later we want to verify that a given property
was set on it:
CopyC#
var mock = new Mock<IWarehouse>(); // exercise mock //... // Will throw if the test code didn't set the IsClosed property. mock.VerifySet(warehouse => warehouse.IsClosed = true);
Exceptions
| Exception | Condition |
|---|---|
| Moq..::.MockException | The invocation was not performed on the mock. |