Closed Seddryck closed 3 years ago
Implemented and documented in 1.23.0-beta.72 or on nuget via Update-Package NBi.Framework -version 1.23.0-beta0072
.
@Seddryck It seems to work only with result-set
element inside union
as schema validation error is thrown during runtime:
NBi.NUnit.Runtime.TestSuite.ExecuteTestCases:
System.ArgumentException : The test suite is not valid. Check with the XSD. 1 error has been found during the validation of the test-suite:
At line 514: The element 'union' in namespace 'http://NBi/TestSuite' has invalid child element 'query' in namespace 'http://NBi/TestSuite'. List of possible elements expected: 'result-set' in namespace 'http://NBi/TestSuite'.
Also, I've looked into the schema, and indeed result-set
is the only element specified for the union
:
<xs:complexType name="union-type">
<xs:sequence>
<xs:element name="result-set" type="result-set-type" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
<xs:attribute name="column-identity" type="column-identity-enum" use="optional"/>
</xs:complexType>
I'm not sure if it's a beta
limitation or a bug 😜
This a feature. If it was directly a query
and not a result-set
, it wouldn't have been possible to add an alteration
to this second result-set
. I'll update the feature-request.
But something to improve is probably that we should be able to have more than a single union
.
Ok. Then I guess docs (https://www.nbi.io/docs/resultset-alteration/) also need an update as there is an example where you can use query inside.
<result-set>
<query>
select 'Apple' as Fruit, 10 as Qty union all select 'Orange', 15
</query>
<alteration>
<union column-identity="name">
<query>
select 5 as Qty, 'Apple' as Fruit, 'Fall' as Season
</query>
</union>
</alteration>
</result-set>
It should be possible to combine two result-sets if they have the same columns.