!3 !c This tutorial describes the ActionFixture element of the [[FIT][http://fit.c2.com]] framework.  It is composed of the following sections:
|Comment|
|ActionFixture|''This page.  Describes the basic functions of the fixture''|
|TimedActionFixture|''Describes how to test time dependent tasks.''|
----
!2 !c Basic Functionality of ActionFixture

ActionFixture allows us to check the results of a sequence of events.  For example, let's write a test for a simple counter.

|Action Fixture.|
|start|!-fitnesse.fixtures.CountFixture-!|
|check|counter|0|
|press|count|
|check|counter|1|
|press|count|
|check|counter|2|
|enter|counter|5|
|press|count|
|check|counter|6|

The metaphor for this fixture is a simple control panel.   
 * You ''press'' buttons that have particular names.  
 * You ''enter'' values into registers that have certain names.  
 * You ''check'' the values of named meters.  

Here is the code for the !-CountFixture-!:{{{public class CountFixture extends Fixture {
  private int counter = 0;
  
  public void count() {
    counter++;
  }
  
  public int counter() {
    return counter;
  }
} }}}  As you can see the names of the buttons, registers and meters correspond directly to methods in the 'started' fixture.  It's really as simple as that.

!img http://files/images/runArrow.gif For more on ActionFixture see: TimedActionFixture.




