Specifies a setup on the mocked type for a call to
to a property setter.
Namespace:
MoqAssembly: Moq (in Moq.dll) Version: 4.0.812.4 (4.0.0.0)
Syntax
| C# |
|---|
public ISetupSetter<T, TProperty> SetupSet<TProperty>( Action<T> setterExpression ) |
Parameters
- setterExpression
- Type: Action<(Of <(T>)>)
Lambda expression that sets a property to a value.
Type Parameters
- TProperty
- Type of the property. Typically omitted as it can be inferred from the expression.
Remarks
If more than one setup is set for the same property setter,
the latest one wins and is the one that will be executed.
This overloads allows the use of a callback already typed for the property type.
Examples
mock.SetupSet(x => x.Suspended = true);