fitSharp
Match Value Fixture

The Match Value fixture obtains a value and executes rows that begin with a matching value. The value is obtained from Symbol Values or from Method Execution in the first row of the table. The rest of the table rows begin with a value to be matched and the rest of the row contains Flow Fixture Keywords or Method Execution.

To use Symbol Values, we include the symbol name in the second cell of the first row.

when input is
story test fixture
checkplain test'sample class'
name mysymbol integer: 2

'match value' mysymbol
1 set field something
2 set field or
3 set field other

check field or
sample class
name mysymbol integer: 2

match value mysymbol
1 set field something
2 set field or
3 set field other

check field or
'sample class'
name mysymbol integer: 2

'match value' mysymbol
1 set field something
2 set field or
3 set field other

check field or
then output is
sample class
name mysymbol integer: 2

match value mysymbol
1 set field something
2 set field or
3 set field other

check field or

We can also obtain a value from Method Execution in the first row of the table.

when input is
story test fixture
checkplain test'sample class'

'match value' 'count by' 2
1 set field something
2 set field or
3 set field other

check field or
sample class

match value count by 2
1 set field something
2 set field or
3 set field other

check field or
'sample class'

'match value' 'count by' 2
1 set field something
2 set field or
3 set field other

check field or
then output is
sample class

match value count by 2
1 set field something
2 set field or
3 set field other

check field or

We can match values using any of the compare Cell Operators. For example, we can use the optional Compare Reg Ex operator. All rows that match the value are executed.

when input is
story test fixture
checkplain test'sample class'

configure processor 'add operator' compareregex

'match value' methodnoparms
/sample.*/ 'count by' 1
/garbage/ 'count by' 2
/.*return/ 'count by' 3

check count 4
sample class

configure processor add operator compareregex

match value methodnoparms
/sample.*/ samplereturn count by 1
/garbage/ samplereturn count by 2
/.*return/ samplereturn count by 3

check count 4
'sample class'

configure processor 'add operator' compareregex

'match value' methodnoparms
/sample.*/ 'count by' 1
/garbage/ 'count by' 2
/.*return/ 'count by' 3

check count 4
then output is
sample class

configure processor add operator compareregex

match value methodnoparms
/sample.*/ samplereturn count by 1
/garbage/ samplereturn count by 2
/.*return/ samplereturn count by 3

check count 4

© Copyright Syterra Software Inc. All rights reserved.