Add up/down _premium_/@round@ support
* insurance.xml (_premium_): Added up/down support for @round@ * test/core/insurance.xml: Associated test casesmaster
parent
44be881050
commit
18fe43b38f
|
@ -93,7 +93,24 @@
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<unless name="@round@" eq="cent">
|
<unless name="@round@" eq="cent">
|
||||||
|
<if name="@round@" eq="up">
|
||||||
|
<c:ceil>
|
||||||
<param-copy name="@values@" />
|
<param-copy name="@values@" />
|
||||||
|
</c:ceil>
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<unless name="@round@" eq="up">
|
||||||
|
<if name="@round@" eq="down">
|
||||||
|
<c:floor>
|
||||||
|
<param-copy name="@values@" />
|
||||||
|
</c:floor>
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<unless name="@round@" eq="down">
|
||||||
|
<!-- no rounding -->
|
||||||
|
<param-copy name="@values@" />
|
||||||
|
</unless>
|
||||||
|
</unless>
|
||||||
</unless>
|
</unless>
|
||||||
</unless>
|
</unless>
|
||||||
</rate-each>
|
</rate-each>
|
||||||
|
|
|
@ -127,6 +127,82 @@
|
||||||
</t:match-result>
|
</t:match-result>
|
||||||
</t:expect>
|
</t:expect>
|
||||||
</t:it>
|
</t:it>
|
||||||
|
|
||||||
|
|
||||||
|
<t:it desc="Performs ceiling when 'up' (low)">
|
||||||
|
<t:premium class="length1"
|
||||||
|
generates="premRoundCeilLow" index="k"
|
||||||
|
round="up">
|
||||||
|
<c:value-of name="#1.1" />
|
||||||
|
</t:premium>
|
||||||
|
|
||||||
|
<t:given name="premRoundCeilLow" />
|
||||||
|
|
||||||
|
<t:expect>
|
||||||
|
<t:match-result>
|
||||||
|
<c:eq>
|
||||||
|
<c:value-of name="#2" />
|
||||||
|
</c:eq>
|
||||||
|
</t:match-result>
|
||||||
|
</t:expect>
|
||||||
|
</t:it>
|
||||||
|
|
||||||
|
|
||||||
|
<t:it desc="Performs ceiling when 'up' (high)">
|
||||||
|
<t:premium class="length1"
|
||||||
|
generates="premRoundCeilHigh" index="k"
|
||||||
|
round="up">
|
||||||
|
<c:value-of name="#1.7" />
|
||||||
|
</t:premium>
|
||||||
|
|
||||||
|
<t:given name="premRoundCeilHigh" />
|
||||||
|
|
||||||
|
<t:expect>
|
||||||
|
<t:match-result>
|
||||||
|
<c:eq>
|
||||||
|
<c:value-of name="#2" />
|
||||||
|
</c:eq>
|
||||||
|
</t:match-result>
|
||||||
|
</t:expect>
|
||||||
|
</t:it>
|
||||||
|
|
||||||
|
|
||||||
|
<t:it desc="Performs floor when 'down' (low)">
|
||||||
|
<t:premium class="length1"
|
||||||
|
generates="premRoundFloorLow" index="k"
|
||||||
|
round="down">
|
||||||
|
<c:value-of name="#1.1" />
|
||||||
|
</t:premium>
|
||||||
|
|
||||||
|
<t:given name="premRoundFloorLow" />
|
||||||
|
|
||||||
|
<t:expect>
|
||||||
|
<t:match-result>
|
||||||
|
<c:eq>
|
||||||
|
<c:value-of name="#1" />
|
||||||
|
</c:eq>
|
||||||
|
</t:match-result>
|
||||||
|
</t:expect>
|
||||||
|
</t:it>
|
||||||
|
|
||||||
|
|
||||||
|
<t:it desc="Performs floor when 'down' (high)">
|
||||||
|
<t:premium class="length1"
|
||||||
|
generates="premRoundFloorHigh" index="k"
|
||||||
|
round="down">
|
||||||
|
<c:value-of name="#1.7" />
|
||||||
|
</t:premium>
|
||||||
|
|
||||||
|
<t:given name="premRoundFloorHigh" />
|
||||||
|
|
||||||
|
<t:expect>
|
||||||
|
<t:match-result>
|
||||||
|
<c:eq>
|
||||||
|
<c:value-of name="#1" />
|
||||||
|
</c:eq>
|
||||||
|
</t:match-result>
|
||||||
|
</t:expect>
|
||||||
|
</t:it>
|
||||||
</t:describe>
|
</t:describe>
|
||||||
</t:describe>
|
</t:describe>
|
||||||
</package>
|
</package>
|
||||||
|
|
Loading…
Reference in New Issue