Array Fixture marks the matching cells.
setup sample array |
column a | column b |
a | x |
a | y |
b | y |
when test is⇓
story test fixture |
check | test result |
sample array |
column a | column b |
a | x |
a | y |
b | y |
|
sample array |
column a | column b |
a | x |
a | y |
b | y |
|
|
sample array |
column a | column b |
a | x |
a | y |
b | y |
| then result is |
sample array |
column a | column b |
a | x |
a | y |
b | y |
|
An array fixture can also use a .NET DataTable as its actual values.
when test is⇓
story test fixture |
check | test result |
sample table array |
column a | column b |
a | x |
a | y |
b | y |
|
sample table array |
column a | column b |
a | x |
a | y |
b | y |
|
|
sample table array |
column a | column b |
a | x |
a | y |
b | y |
| then result is |
sample table array |
column a | column b |
a | x |
a | y |
b | y |
|
The actual values can be a list of different types.
when test is⇓
story test fixture |
check | test result |
sample mixed array |
column a | column b |
a | x |
a | y |
b | y |
|
sample mixed array |
column a | column b |
a | x |
a | y |
b | y |
|
|
sample mixed array |
column a | column b |
a | x |
a | y |
b | y |
| then result is |
sample mixed array |
column a | column b |
a | x |
a | y |
b | y |
|
The values can be any types that can be parsed and compared.
setup sample array |
mother | father |
Jill Sprat | Jack Sprat |
Millie Muffet | Roger Muffet |
when test is⇓
story test fixture |
check | test result |
sample array |
mother | father |
Jill Sprat | Jack Sprat |
Millie Muffet | Roger Muffet |
|
sample array |
mother | father |
Jill Sprat | Jack Sprat |
Millie Muffet | Roger Muffet |
|
|
sample array |
mother | father |
Jill Sprat | Jack Sprat |
Millie Muffet | Roger Muffet |
| then result is |
sample array |
mother | father |
Jill Sprat | Jack Sprat |
Millie Muffet | Roger Muffet |
|
An empty list is matched.
setup sample array |
column a | column b |
when test is⇓
story test fixture |
check | test result |
sample array |
column a | column b |
|
sample array |
column a | column b |
|
|
sample array |
column a | column b |
| then result is |
sample array |
column a | column b |
|
The actual value types can have different methods. Empty cells in the expected values are used when a particular column heading is not applicable.
setup sample array |
column a | column b | other |
a | x | |
a | y | |
b | y | |
| | some |
when test is⇓
story test fixture |
check | test result |
sample array |
column a | column b | other |
a | x | |
a | y | |
b | y | extra |
| | some |
|
sample array |
column a | column b | other |
a | x | |
a | y | |
b | y | extra expected void actual |
| | some |
|
|
sample array |
column a | column b | other |
a | x | |
a | y | |
b | y | extra |
| | some |
| then result is |
sample array |
column a | column b | other |
a | x | |
a | y | |
b | y | extra expected void actual |
| | some |
|
Duplicate rows are matched correctly.
setup sample array |
column a | column b |
a | x |
a | x |
b | y |
when test is⇓
story test fixture |
check | test result |
sample array |
column a | column b |
a | x |
a | x |
b | y |
|
sample array |
column a | column b |
a | x |
a | x |
b | y |
|
|
sample array |
column a | column b |
a | x |
a | x |
b | y |
| then result is |
sample array |
column a | column b |
a | x |
a | x |
b | y |
|