Rows' uniqueness


This assertion checks that all rows of a result-set are unique. If a row has two or more occurences the test will fail. To compare two rows of a result-set, all the columns will be used and all the columns will be considered as text column.

System under test

The system-under-test is a query, please reports to other tests for more information about how to define a query. More info here.

Assertion

The assertion consists in an xml element named unique-rows.

<assert>
  <unique-rows />
</assert>

By default this assertion considers that all columns are keys.

Keys and values

The assertion is comparing two rows of the same datasets based on the columns defined as keys (by default all of them). Values columns are just ignored and won’t be reported in case of failure.

It’s possible to define the keys by yourself by using columns’ index or columns’ name. If you’re using indexes, you can specify the attribute keys

<assert>
  <unique-rows keys="first"/>
</assert>

If the predefined values are not enough, you can also use the following method to define the key columns.

<unique-rows>
  <column index="0" role="value"/>
  <column index="1" role="key" type="numeric"/>
</unique-rows>
<unique-rows>
  <column name="myFirstColumn" role="value"/>
  <column name="mySecondColumn" role="key" type="numeric"/>
</unique-rows>