Test Notes

The Fit version as well as the Java code are available on this site. The system is for a CD Rental store. There are Customers and CDs. The CDFit tests show the flow.

When a CD is checked out, a Rental Contract is printed. When a CD is checked in, a Rental Charge is created that will eventually go to the credit card processor. The tests at the bottom are preparation for a more elaborate rental charging.


The system talks to an SQL database. The place it is referenced is in DatabaseSetup.java. The id, password, and url values are in setup(). Once a database is running (there is a DatabaseSetupTest.java), then you should be able to just run CDFit as a Fit test. I use HSQLDB as an open source DB. But it should work with any DB, as the SQL is generic.

It doesn't have a user interface, since the tests are all Fit. Also I didn't want to direct the UI tests to any particular implementation.

If you want to add a user interface, the interface is two screens:

Checkout - Customer ID, CD ID, and Submit button
Should call Rental Process: RentalContract checkout(CustomerIDADT customerID, PhysicalIDADT physicalID)

Checkin - CD ID and Submit button
Should call RentalProcess: RentalCharge checkIn(PhysicalIDADT physicalID)

Convert from the strings to the ADT's using:
CustomerIDADT( String aString ) throws FormatDeviation - must be 4 characters long
PhysicalIDADT( String aString ) throws FormatDeviation - must be 12 characters long

The RentalContract created during Checkout is printed to the printer.
It's just the data that is inserted into boilerplate text.

The RentalCharge created during Checkin is just data that is sent to another process.