NAME
Test::C2FIT::ColumnFixture - A ColumnFixture maps columns in the test data to fields or methods of its subclasses.
SYNOPSIS
Normally, you subclass ColumnFixture.
package MyColumnFixture;
use base 'Test::C2FIT::ColumnFixture;'
sub getX {
my $self = shift;
return $self->{X};
}
DESCRIPTION
Column headings with braces (e.g. getX()) will get bound to methods, i.e. the data entered in your document will be checked against the result of the respective method. A Column heading consisting of more words will be concatened to a camel-case name ("get name ()" will be mapped to "getName()")
Column headings without braces will be bound to instance variables (=fields). In perl these need not to be predeclared. E.g. when column heading is "surname", then the ColumnFixture puts the text of the respective cell to a variable which can be used by $self->{surname}
. A Column heading consisting of more words will be concatened to a camel-case name ("given name" will be mapped to "givenName")
When your data is not stored as string, then you'll propably need an TypeAdapter. See more in Fixture.
METHODS
- reset()
-
Will be called before a row gets processed
- execute()
-
Will be called either after a row has been processed or before the first usage of a method-column in the row, depending upon which case occurs first.
SEE ALSO
Extensive and up-to-date documentation on FIT can be found at: http://fit.c2.com/