Closed benjaminbelloyan closed 6 years ago
Hello thanks for reporting this. Support for multi dimensionnal arrays delayed until someone requested it, as it requires significant work. I am starting effort now and will keep you posted
hi @benjaminbelloyan I have a working version. Are you interested in testing a pre version with the fix?
Before an official release, I still have to refactor this and review behavior for multi dimensionnal arrays, which means several weeks of delay.
Hi @dupdob Thanks for the quick update. I would indeed be interested in testing the pre version
2.4.0.182-beta is available on myget. It contains the fix for your problem
https://www.myget.org/feed/dupdobnightly/package/nuget/NFluent
Hi @dupdob
The fix seems to be working in some cases. In other cases though, I encountered a DivideByZeroException:
Test Name: Dequeue Test FullName: Kernel.Test.Warehouse.LocalFileWarehouseTestFixture.Dequeue Test Source: C:\Projects\nept-in\smartdataprovider\Kernel\test\Warehouse\LocalFileWarehouseTestFixture.cs : line 53 Test Outcome: Failed Test Duration: 0:00:00,282
Result StackTrace:
à NFluent.Helpers.ReflectionWrapper.GetSubExtendedMemberInfosFields()
à NFluent.Helpers.ReflectionWrapper.MapFields(ReflectionWrapper actual, ICollection1 scanned, Int32 depth, Func
4 mapFunction)
à NFluent.Helpers.ReflectionWrapper.MapFields(ReflectionWrapper actual, ICollection1 scanned, Int32 depth, Func
4 mapFunction)
à NFluent.Helpers.ReflectionWrapper.MemberMatches[TU](TU expectedValue)
à NFluent.ReflectionWrapperChecks.<>c__DisplayClass1_01.<FieldEqualTest>b__0(ReflectionWrapper sut, ICheckLogic
1 test)
à NFluent.Kernel.CheckLogic1.Analyze(Action
2 action)
à NFluent.ReflectionWrapperChecks.FieldEqualTest[TU](ICheck1 check, TU expectedValue, Boolean mustMatch) à NFluent.ReflectionWrapperChecks.IsEqualTo[TU](ICheck
1 check, TU expectedValue)
à NFluent.ObjectFieldsCheckExtensions.HasFieldsWithSameValues[T,TU](ICheck`1 check, TU expected)
à Kernel.Test.Warehouse.LocalFileWarehouseTestFixture.Dequeue() dans C:\Projects\nept-in\smartdataprovider\Kernel\test\Warehouse\LocalFileWarehouseTestFixture.cs:ligne 124
Result Message: System.DivideByZeroException : Tentative de division par zéro.
My 2-dimensions array use case is an array of an abstract class type, that might be a wrapper for a string or int. Don't know if it helps.
Thanks for your feedback. Could you give the dimensions of the array(s)? I do not think the issue relates to what is inside the array
I have been able to understand and fix the issue. I will publish a new beta shortly
I just pushed a new beta. It should fix the divide by zero issue
Hi,
I've tested it this morning in different scenarios, and it seems to be working properly both when arrays content are equal or not. The message points to the correct indexes and is explicit to track down the diff.
I've only tested it with 2 dimensions array for now though, might have 3 dimensions arrays in the future.
Thanks for the great work again
Hello guys,
I'm having an issue with HasFieldsWithSameValues check. My object has a property with multidimensionnal array.
e.g:
When calling HasFieldWithSameValues of a MyType object, I get an argument exception saying that the array doesn't have exactly one dimension.
Any plans on adding the support for multidimensionnal array?
Thanks