11.3. Two-Dimensional ImagesRather than relying on text in Fit tables, it may be better to use images. When the test data is naturally graphical and in a two-dimensional grid format, images can be more direct in expressing the tests that are needed. ImageFixture tables allow this. For example, Figure 11.3 shows part of the tests for a Sokoban[1] program: a table with images in the cells instead of text. This format has been used to test that the current board state of the Sokoban program is correct after several moves have been made.
Figure 11.3. A Table of Images
Programmers The fixture code for the tests here is given in Section 29.3 on p. 251. |