Table of Contents

Method All

Namespace
Xunit
Assembly
xunit.v3.assert.dll

All<T>(IEnumerable<T>, Action<T>)

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

public static void All<T>(IEnumerable<T> collection, Action<T> action)

Parameters

collection IEnumerable<T>

The collection

action Action<T>

The action to test each item against

Type Parameters

T

The type of the object to be verified

Exceptions

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

All<T>(IEnumerable<T>, Action<T, int>)

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 void All<T>(IEnumerable<T> collection, Action<T, int> action)

Parameters

collection IEnumerable<T>

The collection

action Action<T, int>

The action to test each item against

Type Parameters

T

The type of the object to be verified

Exceptions

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