The idea of a fixture isn't new. It's an idea from the hardware world, the manufacture of microchips. When a new chip is created it needs to be analysed and tested. In order to do this the designers would create a special PCB onto which the new chip would be mounted. The PCB would have several connectors from it, these connectors would be connected to test and analysis devices. The PCB is known as a fixture. It's basically an adapter that allows messages to be routed and translated to and from the chip to its test environment. Google search "cpu test fixture" for images of this principle. |
package tdd_with_fitnesse; import java.text.NumberFormat; /** * * @author Selvyn */ public class TimeSheet { public void setCheckInTime(String checkintime) { } public void setCheckOutTime(String checkouttime) { } public void setHourlyRate(String rate) { } public String CheckInTimeNormalized() { return ""; } public String CheckOutTimeNormalized() { return ""; } public String Pay() { return ""; } public String HoursWorked() { return ""; } //returns the number of hours worked public double calculateHoursWorked() { } public void execute() { } } |
The execution order is as follows