tpierrain / NFluent

Smooth your .NET TDD experience with NFluent! NFluent is an ergonomic assertion library which aims to fluent your .NET TDD experience (based on simple Check.That() assertion statements). NFluent aims your tests to be fluent to write (with a super-duper-happy 'dot' auto-completion experience), fluent to read (i.e. as close as possible to plain English expression), but also fluent to troubleshoot, in a less-error-prone way comparing to the classical .NET test frameworks. NFluent is also directly inspired by the awesome Java FEST Fluent assertion/reflection library (http://fest.easytesting.org/)
Apache License 2.0
310 stars 53 forks source link

Add check to check equivalency between two enumerable #249

Closed dupdob closed 6 years ago

dupdob commented 6 years ago

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)

dupdob commented 6 years ago

To be part of next release