fitSharp
Do Fixture
Do Fixture performs Method Execution and invokes Flow Fixture Keywords. If the first fixture in a story test page is a Do Fixture, it operates in Flow Mode. If no fixture is operating in Flow Mode, a default Do Fixture is created for the story test page.

Member names are made by concatenating the odd numbered cells. The even numbered cells are input values.

when input is
story test fixture
checkplain test'sample do'
'name from first' Bob 'and last' Martin
check name 'Bob Martin'
sample do
name from first Bob and last Martin
check name Bob Martin
'sample do'
'name from first' Bob 'and last' Martin
check name 'Bob Martin'
then output is
sample do
name from first Bob and last Martin
check name Bob Martin

A custom keyword, like the Flow Fixture Keywords, can be added to the fixture.

when input is
story test fixture
checkplain test'sample do'
'check digit' 5
'check digit' five
sample do
check digit 5
check digit five
'sample do'
'check digit' 5
'check digit' five
then output is
sample do
check digit 5
check digit five

Any execution that returns boolean is colored with the boolean result.

when input is
story test fixture
checkplain test'sample do'
set 'boolean field' true
'boolean field'
set 'boolean field' false
'boolean field'
sample do
set boolean field true
boolean field
set boolean field false
boolean field
'sample do'
set 'boolean field' true
'boolean field'
set 'boolean field' false
'boolean field'
then output is
sample do
set boolean field true
boolean field
set boolean field false
boolean field

If a fixture is returned, it uses the rest of the current table. The following table returns to Flow Mode.

when input is
story test fixture
checkplain test'sample do'
set name Kim

|'make sample column'
name 'name length?'
Bob 3
Mike 4

check name Kim
sample do
set name Kim

make sample column
name name length?
Bob 3
Mike 4

check name Kim
'sample do'
set name Kim

|'make sample column'
name 'name length?'
Bob 3
Mike 4

check name Kim
then output is
sample do
set name Kim

make sample column
name name length?
Bob 3
Mike 4

check name Kim

If a fixture is named in the first table cell, it uses the table. The following table returns to Flow Mode.

when input is
story test fixture
checkplain test'sample do'
set name Kim

|'sample column'
name 'name length?'
Bob 3
Mike 4

check name Kim
sample do
set name Kim

sample column
name name length?
Bob 3
Mike 4

check name Kim
'sample do'
set name Kim

|'sample column'
name 'name length?'
Bob 3
Mike 4

check name Kim
then output is
sample do
set name Kim

sample column
name name length?
Bob 3
Mike 4

check name Kim

'SetUp' and 'TearDown' methods are called if they exist. When the fixture controls Flow Mode, the teardown is done at the end of the page. Teardown is done even if an exception occurs.

when input is
story test fixture
checkplain test'sample do'
check one 1

set name Bob
throw oops
sample do
check one 1

set name Bob
throw
oops
oops
checklogSetUp() One() set_Name(Bob) TearDown()
'sample do'
check one 1

set name Bob
throw oops
then output is
sample do
check one 1

set name Bob
throw
oops
oops
with logSetUp() One() set_Name(Bob) TearDown()

When another fixture controls Flow Mode, the teardown is done at the end of the table.

when input is
story test fixture
checkplain testdo

'sample do'
check one 1

with new 'sample domain'
set name Bob
do

sample do
check one 1

with new sample domain
set name Bob
checklogSetUp() One() TearDown() set_Name(Bob)
do

'sample do'
check one 1

with new 'sample domain'
set name Bob
then output is
do

sample do
check one 1

with new sample domain
set name Bob
with logSetUp() One() TearDown() set_Name(Bob)

© Copyright Syterra Software Inc. All rights reserved.