-
Notifications
You must be signed in to change notification settings - Fork 2
ComparisonDefinition
This is an example configuration file for defining the comparison behaviour
<?xml version="1.0" encoding="utf-8"?>
<ComparisonDefinition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Delimiter>,</Delimiter>
<KeyColumns>
<Column>ABC</Column>
<Column>DEF</Column>
</KeyColumns>
<ExcludedColumns>
<Column>COL D</Column>
<Column>COL E</Column>
</ExcludedColumns>
<IgnoreInvalidRows>true</IgnoreInvalidRows>
<HeaderRowIndex>0</HeaderRowIndex>
<ToleranceValue>0.1</ToleranceValue>
<ToleranceType>Relative</ToleranceType>
</ComparisonDefinition>
The character used to delimit the csv file, for example ',', '|'
In the table below, the rows are uniquely constrained by column A and column B
A,B,C,D
1,a,x,x
1,b,x,x
1,b,x,x
Sometimes a column will contain data that will always change from one file to another. A timestamp maybe or unique identifier. ExcludedColumns optionally allows such columns to be ignored from the comparison.
If this is set to true then any rows that have a different number of columns will be excluded from the breaks report This is often the case if a footer row is included
A,B,C,D
1,a,x,x
1,b,x,x
1,b,x,x
This is a footer
It can be multiple rows
Some CSV files (not strictly speaking CSV standard) can have additional information in the rows above the column headers.
This is a CSV
With extra rows
A,B,C,D
1,a,x,x
1,b,x,x
1,b,x,x
In this case, set the HeaderRowIndex to 2. 0 the default is for the header on the first row of the file
[Optional] Default = Exact This defines the behaviour of comparison of numeric column values. The tolerance is applied to all numeric values in the file.
ToleranceType can be set to the following values:
Break if there is any difference between values
Break if
Math.Abs( referenceDouble - targetDouble ) > ToleranceValue
Break if
Math.Abs( (referenceDouble - targetDouble) / referenceDouble ) > ToleranceValue
The value used for Absolute or Relative double comparisons This is ignored for Exact ToleranceType