fitSharp
Constraint Fixture
Constraint Fixture executes a method for each row using the row cell values as input. The method name is created by concatenating the header row values. Each row is marked according to the boolean return value of the method.

By default, rows returning true are marked green.

when test is
story test fixture
checktest result
sample constraint
greaterthan
12
21

sample constraint
greaterthan
12
21

sample constraint
greaterthan
12
21
then result is
sample constraint
greaterthan
12
21

We can specify that rows returning false are marked green.

when test is
story test fixture
checktest result
sample constraints

make fixturefalse
greaterthan
12
21

sample constraints

make fixturefalse
greaterthan
12
21

sample constraints

make fixturefalse
greaterthan
12
21
then result is
sample constraints

make fixturefalse
greaterthan
12
21

A repeat string can be set to copy previous row values.

when test is
story test fixture
checktest result
sample constraints

make fixture repeatditto
greaterthan
12
ditto3
21

sample constraints

make fixture repeatditto
greaterthan
12
ditto3
21

sample constraints

make fixture repeatditto
greaterthan
12
ditto3
21
then result is
sample constraints

make fixture repeatditto
greaterthan
12
ditto3
21

'SetUp' and 'TearDown' methods are executed if they exist.

when test is
story test fixture
checktest result
sample constraint
greaterthan
12
21

sample constraint
greaterthan
12
21
checklogSetUp() GreaterThan(1,2) GreaterThan(2,1) TearDown()

sample constraint
greaterthan
12
21
then result is
sample constraint
greaterthan
12
21
with logSetUp() GreaterThan(1,2) GreaterThan(2,1) TearDown()

Errors are reported.

when test is
story test fixture
checktest result
sample constraint
addto
12
21

sample constraint
Method does not return boolean.
addto
12
21

sample constraint
addto
12
21
then result is
sample constraint
Method does not return boolean.
addto
12
21

when test is
story test fixture
checktest result
sample constraint
garbage
12
21

sample constraint
Member 'garbage' with 2 parameter(s) not found for type 'fit.Test.Double.SampleConstraint'.
garbage
12
21

sample constraint
garbage
12
21
then result is
sample constraint
Member 'garbage' with 2 parameter(s) not found for type 'fit.Test.Double.SampleConstraint'.
garbage
12
21

when test is
story test fixture
checktest result
sample constraint
greaterthan
1
321

sample constraint
greaterthan
1
This table is invalid for this fixture: Row should be 2 cells wide.
3
This table is invalid for this fixture: Row should be 2 cells wide.
21

sample constraint
greaterthan
1
321
then result is
sample constraint
greaterthan
1
This table is invalid for this fixture: Row should be 2 cells wide.
3
This table is invalid for this fixture: Row should be 2 cells wide.
21
Copyright © 2022 Syterra Software Inc. All rights reserved.