Set Fixture compares an actual collection of objects to its table of expected values. It is the same as
Array Fixture, except order is not significant.
setup sample array |
column a | column b |
a | x |
a | y |
b | y |
Matching cells are marked.
when test is⇓
story test fixture |
check | test result |
sample set |
column a | column b |
a | x |
a | y |
b | y |
|
sample set |
column a | column b |
a | x |
a | y |
b | y |
|
|
sample set |
column a | column b |
a | x |
a | y |
b | y |
| then result is |
sample set |
column a | column b |
a | x |
a | y |
b | y |
|
Order is ignored.
when test is⇓
story test fixture |
check | test result |
sample set |
column a | column b |
a | y |
b | y |
a | x |
|
sample set |
column a | column b |
a | y |
b | y |
a | x |
|
|
sample set |
column a | column b |
a | y |
b | y |
a | x |
| then result is |
sample set |
column a | column b |
a | y |
b | y |
a | x |
|
Mismatched cells and rows are reported.
when test is⇓
story test fixture |
check | test result |
sample set |
column a | column b |
a | x |
n | o |
b | z |
|
sample set |
column a | column b |
a | x |
n missing | o |
b | z expected y actual At 0 expected z was y |
a surplus |
y | |
|
sample set |
column a | column b |
a | x |
n | o |
b | z |
| then result is |
sample set |
column a | column b |
a | x |
n missing | o |
b | z expected y actual At 0 expected z was y |
a surplus |
y | |