liveBook · Manning

ColumnFixture

As explained in Test Driven: Practical TDD and Acceptance TDD for Java Developers

ColumnFixture is a Fit fixture class that maps table columns to public fields and methods to perform calculations and check results.

A ColumnFixture lets a Fit table check calculation-style business rules: each row supplies inputs, and expected results are compared with the fixture’s output. section 10.2.1

The header row tells Fit how to handle each column:

  • A name such as left sets the matching public field on the fixture from each row’s cell. section 10.2.1
  • A name such as result() marks an expected-result column; Fit calls that method and compares its return value with the row’s expected value. section 10.2.1

A calculator fixture

CalculatorFixture is an example of a class that subclasses fit.ColumnFixture and backs a fixture table. section 10.2.1

Figure 10.5. The column fixture table from figure 10.4 with explanations of the meaning of key elements of the table structure

See the fixture table’s header row and the roles of its key cells. section 10.2.1

How Test Driven: Practical TDD and Acceptance TDD for Java Developers covers it

How deep it goes
Explains how header cells map to public fields or result methods and how expected values are checked.
Examples
Uses a CalculatorFixture subclass and a table whose rows provide inputs and expected results.
What you can do after
Apply Fit to express calculation-style acceptance tests that compare method results with table expectations.
How it connects
Connects Fit fixture tables with public fields, methods, RowFixture, and ActionFixture.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Test Driven: Practical TDD and Acceptance TDD for Java Developers. The section links point to the parts of the book it draws on.