Specify Combine Fixture

CombinationFixture is a specialised fixture for showing how pairs of values are expected to be combined. For example, here's a times table:

fitLib.specify.CombinationFixtureTests.TimesCombination
 123
1123
2246
3369

The fixture for this is as follows:

public class TimesCombination extends CombinationFixture {
    public int combine(int x, int y) {
        return x * y;
    }
}

The method 'combine()' is called for each pair of values, and the result checked. For example, for the cell in the last row above containing an expected value of 6, the method is called with the arguments 'combine(3,2)'.

In general, as usual:

fitLib.specify.CombinationFixtureTests.DirectCombination
 123
100100200300
220220440660
330330660990

The fixture for this class is as follows:

public class DirectCombination extends CombinationFixture {
	public DirectCombination() {
		super(new TimesCombination());
	}
}

It just happens to refer to an object that is also a fixture.