tpierrain/NFluent

Add check to check equivalency between two enumerable

Closed this issue · 1 comments

There is no easy way to assess the content of an IEnumerable disregarding the order of items. NFluent should offer one.

Expected Behavior

// should work
Check.That(new int[] {1,2,3}).IsEquivalentTo(new int[]{3,2,1});
Check.That(new int[] {1,2,3}).IsEquivalentTo(new int[]{1,2,3});
// should fail
Check.That(new int[] {1,2,3,4}).IsEquivalentTo(new int[]{3,2,1});
// should fail
Check.That(new int[] {1,2,3}).IsEquivalentTo(new int[]{4,3,2,1});

Current Behavior

Not supported in the general case.

Possible Solution

Add a new check (proposed name: IsEquivalentTo)

To be part of next release