fitSharp
Calculate Fixture
Calculate Fixture executes one or more methods per row and checks the expected result. The input values are in the leftmost columns, followed by a blank column, followed by one or more expected values. The method names are the expected value column header name concatentated with all the input value header names.

Expected value cells are marked.

when test is
story test fixture
checktest result
sample calculate
abplusminus
11213-11
-2107105-109
01213-12

sample calculate
abplusminus
11213-11
-2107105-109
01213 expected
12 actual
-12

sample calculate
abplusminus
11213-11
-2107105-109
01213-12
then result is
sample calculate
abplusminus
11213-11
-2107105-109
01213 expected
12 actual
-12

Any columns after a second empty column are ignored.

when test is
story test fixture
checktest result
sample calculate
abplusminusnotes
11213-11a comment

sample calculate
abplusminusnotes
11213-11a comment

sample calculate
abplusminusnotes
11213-11a comment
then result is
sample calculate
abplusminusnotes
11213-11a comment

Methods are executed left to right. A method with no inputs can be called.

when test is
story test fixture
checktest result
sample calculate
incrementincrement
12
04

sample calculate
incrementincrement
12
0 expected
3 actual
4

sample calculate
incrementincrement
12
04
then result is
sample calculate
incrementincrement
12
0 expected
3 actual
4

The input column names can be empty.

when test is
story test fixture
checktest result
sample calculate
plus
11213

sample calculate
plus
11213

sample calculate
plus
11213
then result is
sample calculate
plus
11213

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

when test is
story test fixture
checktest result
sample calculates

make fixture with repeatditto
abplus
123
ditto45
2ditto6

sample calculates

make fixture with repeatditto
abplus
123
ditto45
2ditto6

sample calculates

make fixture with repeatditto
abplus
123
ditto45
2ditto6
then result is
sample calculates

make fixture with repeatditto
abplus
123
ditto45
2ditto6

'SetUp' and 'TearDown' methods are called if present.

when test is
story test fixture
checktest result
sample calculate
abplus
11213

sample calculate
abplus
11213
checklogSetUp() PlusAB(1,12) TearDown()

sample calculate
abplus
11213
then result is
sample calculate
abplus
11213
with logSetUp() PlusAB(1,12) TearDown()

Errors are reported.

when test is
story test fixture
checktest result
sample calculate
ab
12

sample calculate
a
This table is invalid for this fixture: No calculated columns.
b
12

sample calculate
ab
12
then result is
sample calculate
a
This table is invalid for this fixture: No calculated columns.
b
12

when test is
story test fixture
checktest result
sample calculate
ab
11213

sample calculate
a
This table is invalid for this fixture: No expected columns.
b
11213

sample calculate
ab
11213
then result is
sample calculate
a
This table is invalid for this fixture: No expected columns.
b
11213

when test is
story test fixture
checktest result
sample calculate
abplusgarbage
1234

sample calculate
abplusgarbage
Member 'garbageab' with 2 parameter(s) not found for type 'fit.Test.Double.SampleCalculateFixture'.
1234

sample calculate
abplusgarbage
1234
then result is
sample calculate
abplusgarbage
Member 'garbageab' with 2 parameter(s) not found for type 'fit.Test.Double.SampleCalculateFixture'.
1234

when test is
story test fixture
checktest result
sample calculate

sample calculate
This table is invalid for this fixture: No header row.

sample calculate
then result is
sample calculate
This table is invalid for this fixture: No header row.

when test is
story test fixture
checktest result
sample calculate
abplus
112
11213
1121314

sample calculate
abplus
1
This table is invalid for this fixture: Row should be 4 cells wide.
12
11213
1
This table is invalid for this fixture: Row should be 4 cells wide.
121314

sample calculate
abplus
112
11213
1121314
then result is
sample calculate
abplus
1
This table is invalid for this fixture: Row should be 4 cells wide.
12
11213
1
This table is invalid for this fixture: Row should be 4 cells wide.
121314

when test is
story test fixture
checktest result
sample calculate
aplus1doublevoid
oneumoneoneone
1two111

sample calculate
aplus1doublevoid
one
Parse parameter 1 for 'fit.Test.Double.SampleCalculateFixture:Plus1A(1)' type System.Int32 failed.
umoneoneone
1two
Input string..was not in a correct format.
111 expected
void actual

sample calculate
aplus1doublevoid
oneumoneoneone
1two111
then result is
sample calculate
aplus1doublevoid
one
Parse parameter 1 for 'fit.Test.Double.SampleCalculateFixture:Plus1A(1)' type System.Int32 failed.
umoneoneone
1two
Input string..was not in a correct format.
111 expected
void actual

Copyright © 2022 Syterra Software Inc. All rights reserved.