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
collectionIEnumerable<T>The collection
actionFunc<T, Task>The action to test each item against
Returns
Type Parameters
TThe 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
collectionIEnumerable<T>The collection
actionFunc<T, int, Task>The action to test each item against
Returns
Type Parameters
TThe type of the object to be verified
Exceptions
Thrown when the collection contains at least one non-matching element