Concordion > Commands > verifyRows > Strategies >

Default match strategy

Since Concordion 2.0.0

The Default strategy can be applied to the verify rows command to verify the rows in the specification in the same order as the collection returned by the fixture.

The strategy is applied by adding the concordion:matchStrategy="Default" attribute to the verify rows command, or just by leaving the strategy unspecified.

This strategy verifies rows top to bottom without modifying the order of the rows.

Examples

Each of the following scenarios uses the command:

<table concordion:verifyRows="#user : users" concordion:matchStrategy="Default">
<tr>
    <th concordion:assertEquals="#user.firstName">First Name</th>
    <th concordion:assertEquals="#user.lastName">Last Name</th>
    <th concordion:assertEquals="#user.age">Age</th>
</tr>
   [ROWS]
</table>

with [ROWS] replaced by the Expected [ROWS] and Result [ROWS].

Scenario Expected [ROWS] Expected Table Actual Result [ROWS] Result Table
All match in same order
<tr>
   <td>John</td>
   <td>Smith</td>
   <td>17</td>
</tr>
<tr>
   <td>Jane</td>
   <td>Dou</td>
   <td>22</td>
</tr>
{John,Smith,17};
{Jane,Dou,22}
<tr>
   <td class="success">John</td>
   <td class="success">Smith</td>
   <td class="success">17</td>
</tr>
<tr>
   <td class="success">Jane</td>
   <td class="success">Dou</td>
   <td class="success">22</td>
</tr>
Does not match in different order
<tr>
  <td>John</td>
  <td>Smith</td>
  <td>17</td>
</tr>
<tr>
  <td>Jane</td>
  <td>Dou</td>
  <td>22</td>
</tr>
{Jane,Dou,22};
{John,Smith,17}
<tr>
     <td class="failure"><del class="expected">John</del>
<ins class="actual">Jane</ins></td>
     <td class="failure"><del class="expected">Smith</del>
<ins class="actual">Dou</ins></td>
     <td class="failure"><del class="expected">17</del>
<ins class="actual">22</ins></td>
   </tr>
   <tr>
     <td class="failure"><del class="expected">Jane</del>
<ins class="actual">John</ins></td>
     <td class="failure"><del class="expected">Dou</del>
<ins class="actual">Smith</ins></td>
     <td class="failure"><del class="expected">22</del>
<ins class="actual">17</ins></td>
</tr>
One row missing
<tr>
   <td>John</td>
   <td>Smith</td>
   <td>17</td>
</tr>
<tr>
   <td>Jane</td>
   <td>Dou</td>
   <td>22</td>
</tr>
{John,Smith,17}
<tr>
   <td class="success">John</td>
   <td class="success">Smith</td>
   <td class="success">17</td>
</tr>
<tr class="missing">
   <td>Jane</td>
   <td>Dou</td>
   <td>22</td>
</tr>
One surplus row
<tr>
   <td>John</td>
   <td>Smith</td>
   <td>17</td>
</tr>
{John,Smith,17};
{Jane,Dou,22}
<tr>
   <td class="success">John</td>
   <td class="success">Smith</td>
   <td class="success">17</td>
</tr>
<tr class="surplus"><td class="failure"><del class="expected"> </del>
<ins class="actual">Jane</ins></td><td class="failure"><del class="expected"> </del>
<ins class="actual">Dou</ins></td><td class="failure"><del class="expected"> </del>
<ins class="actual">22</ins></td></tr>
One field is incorrect
<tr>
   <td>John</td>
   <td>Smith</td>
   <td>17</td>
</tr>
{John,Smith,22}
<tr>
   <td class="success">John</td>
   <td class="success">Smith</td>
   <td class="failure"><del class="expected">17</del>
<ins class="actual">22</ins></td>
   </tr>
Two rows, each with incorrect field
<tr>
   <td>John</td>
   <td>Smith</td>
   <td>17</td>
</tr>
<tr>
   <td>Jane</td>
   <td>Dou</td>
   <td>22</td>
</tr>
{John,Smith,22};
{Jane,Dou,17}
<tr>
   <td class="success">John</td>
   <td class="success">Smith</td>
   <td class="failure"><del class="expected">17</del>
<ins class="actual">22</ins></td>
</tr>
<tr>
   <td class="success">Jane</td>
   <td class="success">Dou</td>
   <td class="failure"><del class="expected">22</del>
<ins class="actual">17</ins></td>
</tr>
Two rows, each with different incorrect field
<tr>
   <td>John</td>
   <td>Smith</td>
   <td>17</td>
</tr>
<tr>
   <td>Jane</td>
   <td>Dou</td>
   <td>22</td>
</tr>
{John,Smither,17};
{Jane,Dou,17}
<tr>
   <td class="success">John</td>
   <td class="failure"><del class="expected">Smith</del>
<ins class="actual">Smither</ins></td>
   <td class="success">17</td>
</tr>
<tr>
   <td class="success">Jane</td>
   <td class="success">Dou</td>
   <td class="failure"><del class="expected">22</del>
<ins class="actual">17</ins></td>
</tr>
Two rows, first with two incorrect fields, second with one
<tr>
   <td>John</td>
   <td>Smith</td>
   <td>17</td>
</tr>
<tr>
   <td>Jane</td>
   <td>Dou</td>
   <td>22</td>
</tr>
{John,Smither,23};
{Jane,Dou,18}
<tr>
   <td class="success">John</td>
   <td class="failure"><del class="expected">Smith</del>
<ins class="actual">Smither</ins></td>
   <td class="failure"><del class="expected">17</del>
<ins class="actual">23</ins></td>
</tr>
<tr>
   <td class="success">Jane</td>
   <td class="success">Dou</td>
   <td class="failure"><del class="expected">22</del>
<ins class="actual">18</ins></td>
</tr>