Specifies a setup on the mocked type for a call to to a property setter.

Namespace:  Moq
Assembly:  Moq (in Moq.dll) Version: 4.0.812.4 (4.0.0.0)

Syntax

C#
public ISetup<T> SetupSet(
	Action<T> setterExpression
)

Parameters

setterExpression
Type: Action<(Of <(T>)>)
Lambda expression that sets a property to a value.

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.

Examples

CopyC#
mock.SetupSet(x => x.Suspended = true);

See Also