







![]() |
Moq |
IMock<(Of <(T>)>)..::.ExpectSet<(Of <(TProperty>)>) Method (<(Of <(<(Of <(T, TProperty>)>)>)>)) |
IMock<(Of <(T>)>) Interface Example See Also Send Feedback |
Sets an expectation on the mocked type for a call to
to a property setter.
Namespace:
Moq
Assembly:
Moq (in Moq.dll) Version: 2.6.1014.1 (2.6.0.0)
Syntax
C# |
---|
IExpectSetter<TProperty> ExpectSet<TProperty>( Expression<Func<T, TProperty>> expression ) |
Parameters
- expression
- Type: Expression<(Of <(Func<(Of <(T, TProperty>)>)>)>)
Lambda expression that specifies the expected property setter.
Type Parameters
- TProperty
- Type of the property. Typically omitted as it can be inferred from the expression.
Remarks
If more than one expectation is set for the same property setter,
the latest one wins and is the one that will be executed.
Examples

mock.ExpectSet(x => x.Suspended);