Table of Contents

Method AllAsync

Namespace
Xunit
Assembly
xunit.v3.assert.dll

AllAsync<T>(IEnumerable<T>, Func<T, Task>)

Verifies that all items in the collection pass when executed against action.

public static Task AllAsync<T>(IEnumerable<T> collection, Func<T, Task> action)

Parameters

collection IEnumerable<T>

The collection

action Func<T, Task>

The action to test each item against

Returns

Task

Type Parameters

T

The type of the object to be verified

Exceptions

Thrown when the collection contains at least one non-matching element

AllAsync<T>(IEnumerable<T>, Func<T, int, Task>)

Verifies that all items in the collection pass when executed against action. The item index is provided to the action, in addition to the item.

public static Task AllAsync<T>(IEnumerable<T> collection, Func<T, int, Task> action)

Parameters

collection IEnumerable<T>

The collection

action Func<T, int, Task>

The action to test each item against

Returns

Task

Type Parameters

T

The type of the object to be verified

Exceptions

Thrown when the collection contains at least one non-matching element