New to Telerik JustMockStart a free 30-day trial

Adds async return helpers to function expectations.

Definition

Namespace:Telerik.JustMock

Assembly:Telerik.JustMock.dll

Syntax:

C#
public static class AsyncExtensions

Inheritance: objectAsyncExtensions

Methods

Specifies the delegate that will execute and return the value for the expected member.

C#
public static IAssertable ReturnsAsync<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TResult>(this FuncExpectation<Task<TResult>> mock, Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TResult> valueFunction)
Parameters:mockFuncExpectation<Task<TResult>>valueFunctionFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TResult>

The function that will evaluate the return value.

Returns:

IAssertable

Reference to IAssertable interface.

Specifies the delegate that will execute and return the value for the expected member.

C#
public static IAssertable ReturnsAsync<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TResult>(this FuncExpectation<Task<TResult>> mock, Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TResult> valueFunction)
Parameters:mockFuncExpectation<Task<TResult>>valueFunctionFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TResult>

The function that will evaluate the return value.

Returns:

IAssertable

Reference to IAssertable interface.

Specifies the delegate that will execute and return the value for the expected member.

C#
public static IAssertable ReturnsAsync<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TResult>(this FuncExpectation<Task<TResult>> mock, Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TResult> valueFunction)
Parameters:mockFuncExpectation<Task<TResult>>valueFunctionFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TResult>

The function that will evaluate the return value.

Returns:

IAssertable

Reference to IAssertable interface.

Specifies the delegate that will execute and return the value for the expected member.

C#
public static IAssertable ReturnsAsync<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TResult>(this FuncExpectation<Task<TResult>> mock, Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TResult> valueFunction)
Parameters:mockFuncExpectation<Task<TResult>>valueFunctionFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TResult>

The function that will evaluate the return value.

Returns:

IAssertable

Reference to IAssertable interface.

Specifies the delegate that will execute and return the value for the expected member.

C#
public static IAssertable ReturnsAsync<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TResult>(this FuncExpectation<Task<TResult>> mock, Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TResult> valueFunction)
Parameters:mockFuncExpectation<Task<TResult>>valueFunctionFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TResult>

The function that will evaluate the return value.

Returns:

IAssertable

Reference to IAssertable interface.

Specifies the delegate that will execute and return the value for the expected member.

C#
public static IAssertable ReturnsAsync<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TResult>(this FuncExpectation<Task<TResult>> mock, Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TResult> valueFunction)
Parameters:mockFuncExpectation<Task<TResult>>valueFunctionFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TResult>

The function that will evaluate the return value.

Returns:

IAssertable

Reference to IAssertable interface.

Specifies the delegate that will execute and return the value for the expected member.

C#
public static IAssertable ReturnsAsync<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TResult>(this FuncExpectation<Task<TResult>> mock, Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TResult> valueFunction)
Parameters:mockFuncExpectation<Task<TResult>>valueFunctionFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TResult>

The function that will evaluate the return value.

Returns:

IAssertable

Reference to IAssertable interface.

Specifies the delegate that will execute and return the value for the expected member.

C#
public static IAssertable ReturnsAsync<T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult>(this FuncExpectation<Task<TResult>> mock, Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult> valueFunction)
Parameters:mockFuncExpectation<Task<TResult>>valueFunctionFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult>

The function that will evaluate the return value.

Returns:

IAssertable

Reference to IAssertable interface.

Specifies the delegate that will execute and return the value for the expected member.

C#
public static IAssertable ReturnsAsync<T1, T2, T3, T4, T5, T6, T7, T8, TResult>(this FuncExpectation<Task<TResult>> mock, Func<T1, T2, T3, T4, T5, T6, T7, T8, TResult> valueFunction)
Parameters:mockFuncExpectation<Task<TResult>>valueFunctionFunc<T1, T2, T3, T4, T5, T6, T7, T8, TResult>

The function that will evaluate the return value.

Returns:

IAssertable

Reference to IAssertable interface.

Specifies the delegate that will execute and return the value for the expected member.

C#
public static IAssertable ReturnsAsync<T1, T2, T3, T4, T5, T6, T7, TResult>(this FuncExpectation<Task<TResult>> mock, Func<T1, T2, T3, T4, T5, T6, T7, TResult> valueFunction)
Parameters:mockFuncExpectation<Task<TResult>>valueFunctionFunc<T1, T2, T3, T4, T5, T6, T7, TResult>

The function that will evaluate the return value.

Returns:

IAssertable

Reference to IAssertable interface.

Specifies the delegate that will execute and return the value for the expected member.

C#
public static IAssertable ReturnsAsync<T1, T2, T3, T4, T5, T6, TResult>(this FuncExpectation<Task<TResult>> mock, Func<T1, T2, T3, T4, T5, T6, TResult> valueFunction)
Parameters:mockFuncExpectation<Task<TResult>>valueFunctionFunc<T1, T2, T3, T4, T5, T6, TResult>

The function that will evaluate the return value.

Returns:

IAssertable

Reference to IAssertable interface.

Specifies the delegate that will execute and return the value for the expected member.

C#
public static IAssertable ReturnsAsync<T1, T2, T3, T4, T5, TResult>(this FuncExpectation<Task<TResult>> mock, Func<T1, T2, T3, T4, T5, TResult> valueFunction)
Parameters:mockFuncExpectation<Task<TResult>>valueFunctionFunc<T1, T2, T3, T4, T5, TResult>

The function that will evaluate the return value.

Returns:

IAssertable

Reference to IAssertable interface.

Specifies the delegate that will execute and return the value for the expected member.

C#
public static IAssertable ReturnsAsync<T1, T2, T3, T4, TResult>(this FuncExpectation<Task<TResult>> mock, Func<T1, T2, T3, T4, TResult> valueFunction)
Parameters:mockFuncExpectation<Task<TResult>>valueFunctionFunc<T1, T2, T3, T4, TResult>

The function that will evaluate the return value.

Returns:

IAssertable

Reference to IAssertable interface.

Specifies the delegate that will execute and return the value for the expected member.

C#
public static IAssertable ReturnsAsync<T1, T2, T3, TResult>(this FuncExpectation<Task<TResult>> mock, Func<T1, T2, T3, TResult> valueFunction)
Parameters:mockFuncExpectation<Task<TResult>>valueFunctionFunc<T1, T2, T3, TResult>

The function that will evaluate the return value.

Returns:

IAssertable

Reference to IAssertable interface.

Specifies the delegate that will execute and return the value for the expected member.

C#
public static IAssertable ReturnsAsync<T1, T2, TResult>(this FuncExpectation<Task<TResult>> mock, Func<T1, T2, TResult> valueFunction)
Parameters:mockFuncExpectation<Task<TResult>>valueFunctionFunc<T1, T2, TResult>

The function that will evaluate the return value.

Returns:

IAssertable

Reference to IAssertable interface.

Specifies the delegate that will execute and return the value for the expected member.

C#
public static IAssertable ReturnsAsync<T1, TResult>(this FuncExpectation<Task<TResult>> mock, Func<T1, TResult> valueFunction)
Parameters:mockFuncExpectation<Task<TResult>>valueFunctionFunc<T1, TResult>

The function that will evaluate the return value.

Returns:

IAssertable

Reference to IAssertable interface.

Specifies the return value for an arranged asynchronous method.

C#
public static IAssertable ReturnsAsync<TResult>(this FuncExpectation<Task<TResult>> mock, Func<TResult> valueFunction)
Parameters:mockFuncExpectation<Task<TResult>>

Expectation for the asynchronous call.

valueFunctionFunc<TResult>

Function that calculates the return value.

Returns:

IAssertable

The current expectation so that you can continue the arrangement.

Returns the specified value from an arranged asynchronous method.

C#
public static IAssertable ReturnsAsync<TResult>(this FuncExpectation<Task<TResult>> mock, TResult value)
Parameters:mockFuncExpectation<Task<TResult>>

Expectation for the asynchronous call.

valueTResult

Value to wrap in a completed task.

Returns:

IAssertable

The current expectation so that you can continue the arrangement.

Specifies the return value for an arranged asynchronous method.

C#
public static IAssertable ReturnsAsync<TResult>(this FuncExpectation<Task> mock, Func<TResult> valueFunction)
Parameters:mockFuncExpectation<Task>

Expectation for the asynchronous call.

valueFunctionFunc<TResult>

Function that calculates the return value.

Returns:

IAssertable

The current expectation so that you can continue the arrangement.

Returns the specified value from an arranged asynchronous method.

C#
public static IAssertable ReturnsAsync<TResult>(this FuncExpectation<Task> mock, TResult value)
Parameters:mockFuncExpectation<Task>

Expectation for the asynchronous call.

valueTResult

Value to wrap in a completed task.

Returns:

IAssertable

The current expectation so that you can continue the arrangement.

In this article
DefinitionMethodsReturnsAsync<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TResult>(FuncExpectation<Task<TResult>>, Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TResult>)ReturnsAsync<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TResult>(FuncExpectation<Task<TResult>>, Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TResult>)ReturnsAsync<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TResult>(FuncExpectation<Task<TResult>>, Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TResult>)ReturnsAsync<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TResult>(FuncExpectation<Task<TResult>>, Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TResult>)ReturnsAsync<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TResult>(FuncExpectation<Task<TResult>>, Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TResult>)ReturnsAsync<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TResult>(FuncExpectation<Task<TResult>>, Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TResult>)ReturnsAsync<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TResult>(FuncExpectation<Task<TResult>>, Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TResult>)ReturnsAsync<T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult>(FuncExpectation<Task<TResult>>, Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult>)ReturnsAsync<T1, T2, T3, T4, T5, T6, T7, T8, TResult>(FuncExpectation<Task<TResult>>, Func<T1, T2, T3, T4, T5, T6, T7, T8, TResult>)ReturnsAsync<T1, T2, T3, T4, T5, T6, T7, TResult>(FuncExpectation<Task<TResult>>, Func<T1, T2, T3, T4, T5, T6, T7, TResult>)ReturnsAsync<T1, T2, T3, T4, T5, T6, TResult>(FuncExpectation<Task<TResult>>, Func<T1, T2, T3, T4, T5, T6, TResult>)ReturnsAsync<T1, T2, T3, T4, T5, TResult>(FuncExpectation<Task<TResult>>, Func<T1, T2, T3, T4, T5, TResult>)ReturnsAsync<T1, T2, T3, T4, TResult>(FuncExpectation<Task<TResult>>, Func<T1, T2, T3, T4, TResult>)ReturnsAsync<T1, T2, T3, TResult>(FuncExpectation<Task<TResult>>, Func<T1, T2, T3, TResult>)ReturnsAsync<T1, T2, TResult>(FuncExpectation<Task<TResult>>, Func<T1, T2, TResult>)ReturnsAsync<T1, TResult>(FuncExpectation<Task<TResult>>, Func<T1, TResult>)ReturnsAsync<TResult>(FuncExpectation<Task<TResult>>, Func<TResult>)ReturnsAsync<TResult>(FuncExpectation<Task<TResult>>, TResult)ReturnsAsync<TResult>(FuncExpectation<Task>, Func<TResult>)ReturnsAsync<TResult>(FuncExpectation<Task>, TResult)
Not finding the help you need?
Contact Support