tpierrain/NFluent

Error using ContainsOnlyElementsThatMatch

Closed this issue · 1 comments

Expected Behavior

I try to use ContainsOnlyElementsThatMatch.
I have an error when executing.
To be sure, I have also copied an exemple from documentation, and have the same error.

Code that reproduce the issue

var integers = new[] { 2, 6 };
// those checks succeed (at least one even entry)
Check.That(integers).ContainsOnlyElementsThatMatch(x => x % 2 == 0);

throw error :
System.InvalidOperationException : L'énumération n'a pas commencé. Appelez MoveNext.
à System.SZArrayHelper.SZGenericArrayEnumerator1.get_Current() à NFluent.EnumerableCheckExtensions.<>c__DisplayClass6_01.b__0(IEnumerable1 sut, ICheckLogic1 test)
à NFluent.Kernel.CheckLogic1.Analyze(Action2 action)
à NFluent.EnumerableCheckExtensions.ContainsOnlyElementsThatMatch

Your Environment

  • Version used: 2.3.1
  • Framework version: (Net 4.6)

Thanks for reporting this issue.
For information, it has been also reported under issue #254.
A fix is available with the NFluent beta available on MyGet (see here.
An official release will be made available in the coming weeks.