Skip to content

EnumerableAssertions<TEnumerable, T> Class

Definition

Provides assertions for enumerable values.

public class EnumerableAssertions<TEnumerable, T> : ObjectAssertions<TEnumerable>
   where TEnumerable : IEnumerable<T>

Type Parameters

Name Description
TEnumerable The type of the enumerable being asserted on.
T The type of elements in the enumerable.

Constructors

Name Description
EnumerableAssertions(TEnumerable) Provides assertions for enumerable values.

Methods

Name Description
Contain(T) Asserts that the enumerable contains the specified item.
Contain(T, IEqualityComparer<T>) Asserts that the enumerable contains the specified item using the specified equality comparer.
Contain(T, Func<T, T, Boolean>)
ContainSingle() Asserts that the enumerable contains exactly one item.
ContainSingle(Func<T, Boolean>, String) Asserts that the enumerable contains exactly one item that satisfies the specified predicate.
NotContain(T) Asserts that the enumerable does not contain the specified item.
NotContain(T, IEqualityComparer<T>) Asserts that the enumerable does not contain the specified item using the specified equality comparer.
NotContain(T, Func<T, T, Boolean>)
NotSequenceEqual(IEnumerable<T>) Asserts that the enumerable is not sequence equal to the expected elements.
NotSequenceEqual(IEnumerable<T>, IEqualityComparer<T>) Asserts that the enumerable is not sequence equal to the expected elements using the specified equality comparer.
NotSequenceEqual(IEnumerable<T>, Func<T, T, Boolean>)
OnlyContain(Func<T, Boolean>, String) Asserts that all items in the enumerable satisfy the specified predicate.
SequenceEqual(IEnumerable<T>) Asserts that the enumerable is sequence equal to the expected elements.
SequenceEqual(IEnumerable<T>, IEqualityComparer<T>) Asserts that the enumerable is sequence equal to the expected elements using the specified equality comparer.
SequenceEqual(IEnumerable<T>, Func<T, T, Boolean>)