Mar 24 2008

Fixture Gallery

Published by gojko

FitNesse resources

Test Driven .NET Development With FitNesse: A detailed guide on using FitNesse and TDD practices to build better .NET software

DbFit: Test-driven database development

Fixture Gallery: Straight-forward examples for the most common fixture types in .NET, Python and Java

FitNesse.Info: Links to other FitNesse related resources.

Getting Fit With .Net: Quick Introduction to Testing .Net Applications with FitNesse

FitNesse-related articles on this web site

Fixture Gallery is a cookbook for FIT/FitNesse tests. It provides developers with a quick overview of the most important fixture types and concepts for agile acceptance testing using the FIT framework. For each fixture type, this document explains the table format and fixture class structure and provides advice when to use and when not to use it. Each example is accompanied by the source code for Java, .NET and Python FIT implementations, in a form that can be easily copied and used as a template for similar fixtures.

Release 2.0 (2008-06-09) is available in three forms:

The source code for all the examples in Python, .NET and Java is available from SourceForge. Get release 2.0 or browse the current development branch.

Intended audience

This document will be most useful to people who are already using FIT and FitNesse to some extent and know the basics, although experienced FIT/FitNesse users might also find a few new tricks here. This is not a good guide to help you get started with FIT or FitNesse. See Fitnesse.Info for a list of resources that will help you take that first step.

This is an open documentation effort — please contribute

My intention with the Fixture Gallery is to start an open documentation project where other people can contribute their notes and ideas about how best to use FIT/FitNesse fixtures. The source code for the document and all examples is hosted on SourceForge. Please help to make this document better either by directly changing it on SourceForge or by modifying the live wiki version on FitNesse.info.

Feedback

To leave comments or feedback, please use the form below.

7 Responses to “Fixture Gallery”

  1. MUlmeron 01 May 2008 at 3:42 pm

    Where can I find the version of the DoFixture that supports the following features…

    Some other shortcuts
    In order to write tests for a large .Net project more efficiently, I
    developed a few extensions for .Net Fit/FitNesse library:
     numeric comparisons >, >=, < and <= can be used in cells for checks
     Nullable types like int? and bool? work properly
     !blank keyword can be used to check if a string is not blank
     symbols (<<name) can be used as fixture parameters. Fixture will get the symbol value
    directly.
     Fixtures can handle object arguments (not just string arguments) with protected ArgsObjects
    array
    Those patches are not part of standard FitNesse distribution, but are free to use, and can be
    downloaded from http://gojko.net/fitnesse.

  2. gojkoon 01 May 2008 at 3:54 pm

    Hi MUlmer,

    the patches are now obsolete. nullable type support was built into the main branch of fitnesse.net a while ago. Regarding blanks and numeric comparisons, you can load support for that using the Cell Handler Loader table.. Here’s an example that enables symbols:

    !|Cell Handler Loader|
    |load|SymbolSaveHandler|FitLibrary|
    |load|SymbolRecallHandler|FitLibrary|
    

    You can get objects from arguments using the GetArgumentInput method (see http://syterra.com/FixtureArguments.html).

  3. [...] really found the FIT/Fitnesse documentation to be very good, maybe I didn’t look har enough. This fixturegallery looks like a good place to start and check when you have [...]

  4. Wes W.on 18 Jun 2008 at 1:00 pm

    This is very good information. I would suggests adding information of the DomainAdapter idea in the latest FitLibrary and SuiteFixture. These work together well to allow you to have one fixture and talk more directly to domain objects.

  5. Kevinon 19 Jun 2008 at 3:06 pm

    I just heard about a Generic Fixture for FitNesse at http://genericfixture.wiki.sourceforge.net/.
    It seems to have only a Java implementation currently.
    Has anyone done similar work (or adapted that Generic Fixture) for use with FitNesse .NET?

  6. gojkoon 22 Jun 2008 at 10:38 pm

    Hi Kevin,

    There is no equivalent of generic fixture for .NET as far as I know.

  7. Wes W.on 25 Jun 2008 at 12:05 pm

    Kevin,

    The DomainAdapter in FitLibrary allows something similar to the GenericFixture you mentioned. It does not completely remove the ability in most complex cases for some ‘fixture’ code but it greatly reduces it and does not require a tester to know class names. The DomainAdapter is available in both .Net and Java versions of FitLibrary. It also offers several ways to do conversion from the strings in the test to your domain objects.

Trackback URI | Comments RSS

Leave a Reply