Action Fixture: Testing Sequences of Events
Sometimes the software behavior you are testing is inherently sequential: a series of events occur in a prescribed order. The Action Fixture style of test table (and FixtureCode) make it easy to write and run tests for such sequences of events. The metaphor for this fixture is a simple control panel:
- You enter values into registers that have specified names.
- You press buttons that have specified names.
- You check the values of named meters.
For example, let's write a test for a simple counter.
Many kinds of event sequences can be boiled down to sets of these simple actions: entering, pressing, and checking. This style of table is often used, for example, to check sequences of user interface events.
To see the FixtureCode for this example, check out Action Fixture Code.
Seeing How Long Action Fixture Actions Take: TimedActionFixture
You can used TimedActionFixture if you want to see visual feedback on how long certain functions take to execute. (Technical note: This is strictly a matter of making sure that the FixtureCode[?] for your table extends TimedActionFixture instead of Action Fixture.) Here is a version of our counter example that uses TimedActionFixture:
This DelayedCountFixture example simply adds a random delay to the count function.
TimedActionFixture does not give you a means of testing the time or the split. It simply displays them for visual inspection. Also note that the Timed Action Fixture does not report any delays that are less than one second. We don't know why Ward (inventor of the FitFramework) decided to impose this lower limit. Perhaps he'll remove it one day.
Learning MoreTo see an example of the fixture code for the Action Fixture test table style, check out Action Fixture Code. Also check out the other Test Table Styles.
Keyboard Shortcuts ?
- t Test page or suite
- e Edit page
- v View page (after test)
- a Add new page
- g u User Guide
- g q Quick Reference Guide
- g f Full Reference Guide
- g c Recent Changes
- CTRL+s Save page
- ESC Cancel edit
- p Properties
- w Where used?
- AK+v Versions
- AK+h Page History
- / Focus on search bar
- s Open search page