PeanutButter
Loading...
Searching...
No Matches
PeanutButter.TestUtils.Generic.EnumerableExtensions Class Reference

Extensions for IEnumerables. More...

Static Public Member Functions

static void ShouldMatchDataIn< T1, T2 > (this IEnumerable< T1 > src, IEnumerable< T2 > other)
 Tests if src collection does not match data in other collection.
static void ShouldMatchDataInAndOrderOf< T1, T2 > (this IEnumerable< T1 > src, IEnumerable< T2 > other)
 Tests that two collections have the same data in the same order.
static bool IsEquivalentTo< T > (this IEnumerable< T > src, IEnumerable< T > other)
 Tests if two collections have equivalency (same items, order not guaranteed). Will rely on .Equals() on T.
static void ShouldHaveUnique< T > (this IEnumerable< T > src, Func< T, bool > matcher)
 Asserts that the provided Func filters to one unique value.
static void ShouldContainOneDeepEqualTo< T > (this IEnumerable< T > src, T seek, params string[] ignoreProperties)
 Asserts that the collection being operated on contains exactly one value deep equal to the provided one.
static void ShouldContainAtLeastOneDeepEqualTo< T > (this IEnumerable< T > src, T seek, params string[] ignoreProperties)
 Asserts that the collection being operated on contains at least one value deep equal to the provided one.

Detailed Description

Extensions for IEnumerables.

Member Function Documentation

◆ IsEquivalentTo< T >()

bool PeanutButter.TestUtils.Generic.EnumerableExtensions.IsEquivalentTo< T > ( this IEnumerable< T > src,
IEnumerable< T > other )
static

Tests if two collections have equivalency (same items, order not guaranteed). Will rely on .Equals() on T.

Parameters
src
other
Template Parameters
T
Returns

◆ ShouldContainAtLeastOneDeepEqualTo< T >()

void PeanutButter.TestUtils.Generic.EnumerableExtensions.ShouldContainAtLeastOneDeepEqualTo< T > ( this IEnumerable< T > src,
T seek,
params string[] ignoreProperties )
static

Asserts that the collection being operated on contains at least one value deep equal to the provided one.

Parameters
src
seek
ignoreProperties
Template Parameters
T

◆ ShouldContainOneDeepEqualTo< T >()

void PeanutButter.TestUtils.Generic.EnumerableExtensions.ShouldContainOneDeepEqualTo< T > ( this IEnumerable< T > src,
T seek,
params string[] ignoreProperties )
static

Asserts that the collection being operated on contains exactly one value deep equal to the provided one.

Parameters
src
seek
ignoreProperties
Template Parameters
T

◆ ShouldHaveUnique< T >()

void PeanutButter.TestUtils.Generic.EnumerableExtensions.ShouldHaveUnique< T > ( this IEnumerable< T > src,
Func< T, bool > matcher )
static

Asserts that the provided Func filters to one unique value.

Parameters
src
matcher
Template Parameters
T

◆ ShouldMatchDataIn< T1, T2 >()

void PeanutButter.TestUtils.Generic.EnumerableExtensions.ShouldMatchDataIn< T1, T2 > ( this IEnumerable< T1 > src,
IEnumerable< T2 > other )
static

Tests if src collection does not match data in other collection.

  • type-agnostic: types with the same "shape" will match
  • does not care about order
Parameters
srcPrimary source collection
otherCollection to compare with
Template Parameters
T1Type of collection 1
T2Type of collection 2

◆ ShouldMatchDataInAndOrderOf< T1, T2 >()

void PeanutButter.TestUtils.Generic.EnumerableExtensions.ShouldMatchDataInAndOrderOf< T1, T2 > ( this IEnumerable< T1 > src,
IEnumerable< T2 > other )
static

Tests that two collections have the same data in the same order.

Parameters
src
other
Template Parameters
T1
T2

The documentation for this class was generated from the following file:
  • source/TestUtils/PeanutButter.TestUtils.Generic/EnumerableExtensions.cs