Skip to content

InvokingExtensions.Awaiting Method ​

Overloads ​

NameDescription
Awaiting<T>(T, Func<T, Task>)Wraps an async action on the specified value for assertion testing.
Awaiting<T, TResult>(T, Func<T, Task<TResult>>)Wraps an async function on the specified value for assertion testing, discarding the return value.

Awaiting<T>(T, Func<T, Task>) ​

Wraps an async action on the specified value for assertion testing.

c#
public static Func<Task> Awaiting<T>(this T? value, Func<T, Task> action);

View source

Type Parameters ​

NameDescription
TThe type of the value.

Parameters ​

NameTypeDescription
valueTThe value to pass to the async action.
actionFunc<T, Task>The async action to test.

Returns ​

Func<Task>

A Func<TResult> that invokes the specified async action with the value, for use with Should(Func<Task>).

Awaiting<T, TResult>(T, Func<T, Task<TResult>>) ​

Wraps an async function on the specified value for assertion testing, discarding the return value.

c#
public static Func<Task> Awaiting<T, TResult>(this T? value, Func<T, Task<TResult>> action);

View source

Type Parameters ​

NameDescription
TThe type of the value.
TResultThe return type of the async function.

Parameters ​

NameTypeDescription
valueTThe value to pass to the async function.
actionFunc<T, Task<TResult>>The async function to test.

Returns ​

Func<Task>

A Func<TResult> that invokes the specified async function with the value, for use with Should(Func<Task>).