Array Fixture compares an actual collection of objects to its table of expected values. The second row of the table is a header row containing the member names to be checked in the actual objects. The order of rows is significant in the comparison.
An unmatched object in the actual collection is shown as surplus.
| setup sample array |
| column a |
| a |
| b |
| c |
| check | test result |
| sample array |
| column a |
| a |
| c |
| | sample array | | column a | | a | | c |
| b surplus |
|
An unmatched row in the expected values is marked as missing.
| setup sample array |
| column a |
| a |
| c |
| check | test result |
| sample array |
| column a |
| a |
| b |
| c |
| | sample array | | column a | | a | | b missing | | c |
|
Both surplus and missing rows are handled.
| setup sample array |
| column a |
| a |
| d |
| c |
| check | test result |
| sample array |
| column a |
| a |
| b |
| c |
| | sample array | | column a | | a | | b missing | | c |
| d surplus |
|
Duplicate rows are matched correctly.
| setup sample array |
| column a |
| a |
| a |
| c |
| check | test result |
| sample array |
| column a |
| a |
| a |
| c |
| |
Encoded text is handled.
| setup sample array |
| column a |
| <stuff> |
| check | test result |
| | sample array | | column a |
| <stuff> surplus |
|