MockerHttpExtensions..::..SetupMessageAsync<(Of <(<'TMock, TReturn>)>)> Method

Setups the message asynchronous.

Namespace:  FastMoq.Extensions
Assembly:  FastMoq.Core (in FastMoq.Core.dll)

Syntax


public static void SetupMessageAsync<TMock, TReturn>(
	this Mocker mocker,
	Expression<Func<TMock, Task<TReturn>>> expression,
	Func<TReturn> messageFunc
)
<ExtensionAttribute> _
Public Shared Sub SetupMessageAsync(Of TMock, TReturn) ( _
	mocker As Mocker, _
	expression As Expression(Of Func(Of TMock, Task(Of TReturn))), _
	messageFunc As Func(Of TReturn) _
)
[ExtensionAttribute]
public:
generic<typename TMock, typename TReturn>
static void SetupMessageAsync(
	Mocker^ mocker, 
	Expression<Func<TMock, Task<TReturn>^>^>^ expression, 
	Func<TReturn>^ messageFunc
)

Type Parameters

TMock
The type of the mock.
TReturn
The type of the return value.

Parameters

mocker
Type: FastMoq..::..Mocker
The mocker.
expression
Type: Expression<(Of <(<'Func<(Of <(<'TMock, Task<(Of <(<'TReturn>)>)>>)>)>>)>)>
The expression.
messageFunc
Type: Func<(Of <(<'TReturn>)>)>
The message function.

Exceptions


ExceptionCondition
InvalidDataExceptionUnable to setup '{typeof(TMock)}'.