Callback Method

Moq 2.6

Specifies a callback to invoke when the property is set that receives the property value being set.

Namespace:  Moq.Language
Assembly:  Moq (in Moq.dll) Version: 2.6.1014.1 (2.6.0.0)

Syntax

C#
ICallbackResult Callback(
	Action<TProperty> callback
)

Parameters

callback
Type: Action<(Of <(TProperty>)>)
Callback method to invoke.

Examples

Invokes the given callback with the property value being set.
CopyC#
mock.ExpectSet(x => x.Suspended)
    .Callback((bool state) => Console.WriteLine(state));

See Also