FitNesse. UserGuide. FitLibraryUserGuide. DoFixture.
FixtureDetails [add child]

Calling a method from an action

The keywords of an action are concatentated together, with spaces between and converted into a valid Java identifier. This is done using extended camel casing[?].

Rules for coloring

Auto-Wrapping

The value returned by the method corresponding to an action may be auto-wrapped with a fixture, as follows:
This fixture object, or the one returned explicitly, is used to interpret the rest of the table.

Fixture as Adapter

An object may be associated with a DoFixture (by calling the method setSystemUnderTest(Object) or through the super() constructor). If there is no method in the DoFixture corresponding to an action, DoFixture tries to call that method on the SystemUnderTest object instead (if it's been defined). (This approach is also used in CalculateFixture[?] and SetUpFixture[?].)

This means that a subclass of DoFixture is only needed as an adapter, when actions don't map directly onto methods of the SystemUnderTest object.

Domain Objects

If an action corresponds to a property, the value of that property is returned. The value may be an Object.

Because some Objects are auto-wrapped with DoFixture, it's possible to access and test domain objects directly, without the need to write fixtures.

Tests without Fixture

Because of auto-wrapping and Domain objects, it's possible to use Fit for testing without the need to write any fixtures at all (inspired by Naked Objects).My original aim in introducing these facilities was to enable the use of Fit in teaching beginner programmers, but I found them generally useful.

This approach depends on two experimental special actions in DoFixture:

This may need more work to make it general enough...

Here's a trivial example:

fitlibrary.DoFixture
start java.awt.Rectangle

check x 0
check y 0

set location 100   200
check x 100
check y 200
location
move 12   14
check x 12
check y 14
check x 100
check y 200

set size 20   30
check width 20
check height 30