Table of Contents

Struct InvocationFunc

Namespace
Moq
Assembly
Moq.dll

A delegate-like type for use with setup.Returns which instructs the Returns verb to provide the callback with the current IInvocation, instead of with a list of arguments.

This type is useful in scenarios involving generic type argument matchers (such as It.IsAnyType) as IInvocation allows the discovery of both arguments and type arguments.

public readonly struct InvocationFunc
Inherited Members

Constructors

InvocationFunc(Func<IInvocation, object>)

Initializes a new instance of the InvocationFunc type.

public InvocationFunc(Func<IInvocation, object> func)

Parameters

func Func<IInvocation, object>

The delegate that should be wrapped by this instance.