Fixtures may compare expected values provided in cells to actual values provided by the system under test.
CellMatching | ||||||
actual type | actual value | expected value | matches | |||
string | aaa | aaa | True | a string is equal to expected | ||
string | aaa | bbb | False | a string is not equal to expected | ||
int | 5 | 5 | True | a number is equal to expected | ||
int | 5 | 6 | False | a number is not equal to expected | ||
int | 5 | xxx | Exception | a number doesn't match an invalid value |
Special symbols and keywords can be used in the expected value cells.
Numbers can use comparison operators.
CellMatching | ||||||
actual type | actual value | expected value | matches | |||
int | 5 | >4 | True | |||
int | 5 | >5 | False | |||
int | 5 | >=4 | True | |||
int | 5 | >=5 | True | |||
int | 5 | >=6 | False | |||
decimal | 4.999999999999999999999 | <5 | True | comparisons work for decimals | ||
decimal | 5 | <5 | False | |||
double | .9999999999E-18 | <=1E-18 | True | and for doubles | ||
double | 1E-18 | <=1E-18 | True | |||
double | 1.0000000000001E-18 | <=1E-18 | False | |||
int | 5 | Exception | comparison fails with an invalid value | | ||
string | 5 | >4 | False | comparison operators are only for numbers | ||
byte | 5 | >4 | True | here's the other valid types for comparisons | ||
sbyte | 5 | >4 | True | |||
float | 5.0 | >4.0 | True | |||
uint | 5 | >4 | True | |||
long | 5 | >4 | True | |||
ulong | 5 | >4 | True | |||
short | 5 | >4 | True | |||
ushort | 5 | >4 | True |
Numeric comparisons can be combined with symbol recall.
CellMatching | |||||||
actual type | actual value | expected value | matches | expected cell | |||
int | 3 | ><<four | False | <span class="fit_grey">3 </span>><<four<span class="fit_grey"> 4</span> | symbol values can be recalled for comparison | ||
int | 3 | < <<four | True | <span class="fit_grey">3 </span>< <<four<span class="fit_grey"> 4</span> | use whitespace to disambiguate 'less than' and 'recall' | ||
int | 3 | '<<four' | False | <<four<span class="fit_grey"> 4</span> | this is recall, not a comparison |
When a cell match fails, the Cell Differences are displayed.