You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is rather complex to reproduce but at least with computer settings set to fr-be and the following test:
<?xml version="1.0" encoding="utf-8"?>
<testSuitexmlns:xsd="http://www.w3.org/2001/XMLSchema"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns="http://NBi/TestSuite">
<testname="alteration with replacement of a text value by a numeric value">
<system-under-test>
<result-set>
<row>
<cell>39.500</cell>
<cell>8.200</cell>
</row>
</result-set>
</system-under-test>
<assert>
<equal-tobehavior="single-row"values-default-type="text">
<result-set>
<row>
<cell>2018-10-01</cell>
<cell>8.200</cell>
</row>
<alteration>
<lookup-replace>
<missingbehavior="default-value">0</missing>
<join>
<mappingcandidate="#0"reference="#0" />
</join>
<result-set>
<row>
<cell>2018-10-01</cell>
<cell>39.500</cell>
</row>
<alteration>
<summarize>
<sumcolumn="#1"type="numeric" />
<group-by>
<columnidentifier="#0" />
</group-by>
</summarize>
</alteration>
</result-set>
<replacementidentifier="#1" />
</lookup-replace>
</alteration>
</result-set>
</equal-to>
</assert>
</test>
</testSuite>
We've the following result:
NBi.NUnit.Runtime.TestSuite.alteration with replacement of a text value by a numeric value:
NBi.NUnit.Runtime.CustomStackTraceAssertionException :
Execution of the query doesn't match the expected result
Expected:
Result-set with 1 row
#0 (Column0) | #1 (Column1)
VALUE (Text) | VALUE (Text)
------------ | ------------
39,5 | 8.200
But was:
Result-set with 1 row
#0 (Column0) | #1 (Column1)
VALUE (Text) | VALUE (Text)
------------ | ------------
39.500 | 8.200
Non matching value rows:
------------------------
Result-set with 1 row
#0 (Column0) | #1 (Column1)
VALUE (Text) | VALUE (Text)
-------------- | ------------
39.500 <> 39,5 | 8.200
The text was updated successfully, but these errors were encountered:
The summarize alteration is returning a numeric. During the lookup-replace, the replacement-values which have been calculated by the summarize (and so are numeric) are casted back to text. Due to the regional settings, the value 39.5(numeric) is casted to 39,5(text). Later during the equal-to, this value is recasted to a numeric ... but this is not possible due to the standard way of writing numbers not respected ... by "chance" the caster returns 395(numeric) ... and that's obviously wrong. Clearly, when writing the code for the TextCaster, I didn't think that this class could be called with something else than a text, I fixed this wrong assumption in this build and it should, now, cast the value 39.5(numeric) to 39.5(text) and this value will be casted back to a numeric in the equal-to with the value 39.5(numeric).
Nevertheless, we still have an issue: it's pointless to cast the replacement-values to a text. Unfortunately, the underlying method is called by many important classes and providing an alternative to not cast in a few cases is touchy. To avoid this, I introduced a new type untyped and asked to cast the replacement-values to this type (it doesn't do anything in fact). Again, a few things started to break. I fixed them, but this change is really in the core of NBi so be careful with this other build. Feedback on this build is especially welcome, sooner or later, I'll need to merge to the develop branch and it's probably better to test before it's merged.
This is rather complex to reproduce but at least with computer settings set to fr-be and the following test:
We've the following result:
The text was updated successfully, but these errors were encountered: