Skip to content

InvokingExtensions.Invoking Method ​

Overloads ​

NameDescription
Invoking<T>(T, Action<T>)Wraps an action on the specified value for assertion testing.
Invoking<T, TResult>(T, Func<T, TResult>)Wraps a function on the specified value as an action for assertion testing, discarding the return value.

Invoking<T>(T, Action<T>) ​

Wraps an action on the specified value for assertion testing.

c#
public static Action Invoking<T>(this T? value, Action<T> action);

View source

Type Parameters ​

NameDescription
TThe type of the value.

Parameters ​

NameTypeDescription
valueTThe value to pass to the action.
actionAction<T>The action to test.

Returns ​

Action

An action that invokes the specified action with the value, for use with Should(Action).

Invoking<T, TResult>(T, Func<T, TResult>) ​

Wraps a function on the specified value as an action for assertion testing, discarding the return value.

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

View source

Type Parameters ​

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

Parameters ​

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

Returns ​

Action

An action that invokes the specified function with the value, for use with Should(Action).