Here we use images in a GridFixture; they can be used as a value with any of the FitLibrary fixtures.
fit.specify.GridFixtureUnderTest |
The corresponding code:
public class GridFixtureUnderTest extends DoFixture {
public Fixture images() {
return new GridFixture(new ImageNameGraphic[][] {
{ new ImageNameGraphic("images/wall.jpg"),
new ImageNameGraphic("images/space.jpg"),
new ImageNameGraphic("images/box.jpg"),
new ImageNameGraphic("images/space.jpg"),
new ImageNameGraphic("images/wall.jpg") }});
}
Because the type is ImageNameGraphic, the values in the grid are treated specially. The file name for the image is compared against the file name in the ImageNameGraphic.