There are a number of examples in the Fit distribution. The HTML source for the examples is in the fat/Documents directory, custom fixtures are in the eg directory. The results of running the samples should go into the fat/Reports directory. The 'a all' script in the tests directory will run all of the examples. This script only works on Windows XP; you'll have to write your own for any other system. See the writup on the various runners.
All examples run using FileRunner, however, some of them may require WikiRunner if you want to run them with a different language version of FIT.
This is a five line fixture that inherits from ColumnFixture and tests out a few division problems. Notice the comment column, and that since this extends ColumnFixture we get the standard TypeAdpater for floats for free.
This is a simple example that shows off two custom fixtures: Arithmetic Fixture is a subclass of Primitive Fixture, and Arithmetic Column Fixture is a subclass of ColumnFixture. There's not much to say about it except that the simplicity makes it a good first example to investigate. A number of the errors are deliberate to show off what error handling looks like. The rest of the errors are because I've never quite figured out how floating point exception handling should work, and Python doesn't have a consistent model. See PEP 754 for a discussion of the issues in floating point exception handling.
Or more properly binary search. This is one of a series of practice problems that Dave Thomas (the Pragmatic Programmer) has been publishing. He calls them Katas, and suggests doing them several different ways. It's based on ColumnFixture and has a number of notes from when I converted it.
This is a simulation of an HP-35, Hewlett-Packard's first pocket calculator. The actual hardware had a reputation for durability. This example is based on ColumnFixture, and it isn't all there yet. There are several errors that I haven't corrected.
This is a good example of a fixture that runs other tests. Besides the fixture, it's got another interesting wrinkle: the footnote mechanism for saving the failing tests. This footnote mechanism will be removed or revised in a future release.
Several of the tests fail. I've put in a note column as a comment on the failures.
This runs a fixture that runs all of the tests in a directory. It lets you specify a different directory on each row, and it has the full power of the Python Glob module. (The Java version only allows an asterisk.) There are some strange results here that I haven't tracked down yet.
It's no longer the best method of doing this: use the FolderRunner instead. That supports a large number of additional options.
One interesting and possibly useful niche for this is in doing crosscuts: plucking tests that are related to different things from different directories.
This is an example of how to set up a fixture that tests all possible combinations of several things. This kind of exhaustive check is sometimes necessary, but see the comments in the test case: it isn't as useful as you might think if you can't come up with an independent source of answers for each combination.
AllCombinations might be a bit much, so AllPairs gives an alternative. This one tries to generate one test that contains each possible pair of values. The original routine used a variant of the bin packing algorithm; this one uses a far simpler routine: generate all combinations and then winnow the list. For the test data, it generates fewer cases. (It might also be wrong - I need to get back to it and check it.)
This is a large simulation of a music system. It's a good example of putting everything together with ActionFixture to run things, and a RowFixture derivative to check that results are what they expect.
This is essentially the same as Music Example, except that it's written using DoFixture. It attempts to use the SUT (Software Under Test) facility to avoid writing a fixture, with some degree of success. It uses two custom type adapters and showcases the new DisplayUtility.
These are acceptance tests for a couple of the changes in the 0.4 release.
This is an acceptance test for one of the fixtures in the old version of Fitnesse. It's not needed any longer.
This example, which is currently in fit.AccTests with the fixtures in fit.AccTestFixtures, is a fairly large example of how to use a table that looks like a business form. The form is taken verbatim from page 82 of the Fit Book, the original version of TableFixture comes from FitNesse and the root fixture itself is in fitnesse.fixtures.
This shows how to use the same table to create an object (an invoice with two line items) and to verify the information in the object. It does the verification two ways: one with specific logic in the fixture, the other using the TypeAdapter mechanism. The latter provides less code with more functionality.