Closed JasonBoggsAtHMSdotCom closed 2 weeks ago
we have code coverage in place. basically, any new code needs a unit test. i think you must apply ExcludeFromCodeCoverage attribute to your class so it passes the code coverage in the build action check
i am going to merge this but it will need the code coverage changes
Fixes https://github.com/asulwer/RulesEngine/issues/75
This PR fixes an issue with how empty arrays, provided via an expando object, are handled by the rules engine. System.Linq is checking the data type of the expected underlying object before comparing the contents of the actual object. This is causing issues when empty arrays are provided in json bodies, and these get converted to a
List<object>
. If you have a rule expression that looks something likewidgets.Any(a == 3)
, andwidgets
is an empty array, the expression parser in System.Linq would experience an issue comparing anobject
to an integer.To fix this issue, this PR creates a new class named
ImplicitObject
which contains implicit operators for every logical data type that can be passed in from a json object.Run the following code: