CombinationFixture

CombinationFixture is used to perform an operation on pairs on values. The values are specified in a row and a column and the operation is performed on all combinations of values.

Table Format

The first row of the table is the fixture class name. The second row contains an empty cell followed by cells containing the values to be used as the second parameter for the operation. All subsequent rows contain a value in the first cell to be used as the first parameter for the operation, followed by cells containing the expected value of the operation.

!|MyDivisionCombinationFixture|
|  |1 |2|3|
|6 |6 |3|2|
|12|12|6|4|

Fixture class

The fixture class should extend fitlibrary.CombinationFixture. It should declare a method 'combine' which takes two values and returns a value.

Java Source Code

package info.fitnesse.fixturegallery;

import fitlibrary.CalculateFixture;

public class MyDivisionCombinationFixture extends CombinationFixture{
	public int combine(int theFirst, int theSecond) {
		return theFirst / theSecond;
	}
}

.NET Source Code

using fitlibrary;

namespace info.fitnesse.fixturegallery {
	public class myDivisionCombinationFixture: CombinationFixture {
		public int combine(int theFirst, int theSecond) {
			return theFirst / theSecond;
		}
	}
}

Personal Tools