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 |
check | test result |
sample calculate |
a | b | | plus | minus |
1 | 12 | | 13 | -11 |
-2 | 107 | | 105 | -109 |
0 | 12 | | 13 | -12 |
|
sample calculate |
a | b | | plus | minus |
1 | 12 | | 13 | -11 |
-2 | 107 | | 105 | -109 |
0 | 12 | | 13 expected 12 actual | -12 |
|
|
sample calculate |
a | b | | plus | minus |
1 | 12 | | 13 | -11 |
-2 | 107 | | 105 | -109 |
0 | 12 | | 13 | -12 |
| then result is |
sample calculate |
a | b | | plus | minus |
1 | 12 | | 13 | -11 |
-2 | 107 | | 105 | -109 |
0 | 12 | | 13 expected 12 actual | -12 |
|
Any columns after a second empty column are ignored.
when test is⇓
story test fixture |
check | test result |
sample calculate |
a | b | | plus | minus | | notes |
1 | 12 | | 13 | -11 | | a comment |
|
sample calculate |
a | b | | plus | minus | | notes |
1 | 12 | | 13 | -11 | | a comment |
|
|
sample calculate |
a | b | | plus | minus | | notes |
1 | 12 | | 13 | -11 | | a comment |
| then result is |
sample calculate |
a | b | | plus | minus | | notes |
1 | 12 | | 13 | -11 | | a comment |
|
Methods are executed left to right. A method with no inputs can be called.
when test is⇓
story test fixture |
check | test result |
sample calculate |
| increment | increment |
| 1 | 2 |
| 0 | 4 |
|
sample calculate |
| increment | increment |
| 1 | 2 |
| 0 expected 3 actual | 4 |
|
|
sample calculate |
| increment | increment |
| 1 | 2 |
| 0 | 4 |
| then result is |
sample calculate |
| increment | increment |
| 1 | 2 |
| 0 expected 3 actual | 4 |
|
The input column names can be empty.
when test is⇓
story test fixture |
check | test result |
sample calculate |
| | | plus |
1 | 12 | | 13 |
|
sample calculate |
| | | plus |
1 | 12 | | 13 |
|
|
sample calculate |
| | | plus |
1 | 12 | | 13 |
| then result is |
sample calculate |
| | | plus |
1 | 12 | | 13 |
|
A repeat string can be set to copy input values from the previous row.
when test is⇓
story test fixture |
check | test result |
make fixture with repeat | ditto |
a | b | | plus |
1 | 2 | | 3 |
ditto | 4 | | 5 |
2 | ditto | | 6 |
|
make fixture with repeat | ditto |
a | b | | plus |
1 | 2 | | 3 |
ditto | 4 | | 5 |
2 | ditto | | 6 |
|
|
make fixture with repeat | ditto |
a | b | | plus |
1 | 2 | | 3 |
ditto | 4 | | 5 |
2 | ditto | | 6 |
| then result is |
make fixture with repeat | ditto |
a | b | | plus |
1 | 2 | | 3 |
ditto | 4 | | 5 |
2 | ditto | | 6 |
|
'SetUp' and 'TearDown' methods are called if present.
when test is⇓
story test fixture |
check | test result |
sample calculate |
a | b | | plus |
1 | 12 | | 13 |
|
sample calculate |
a | b | | plus |
1 | 12 | | 13 |
|
check | log | SetUp() PlusAB(1,12) TearDown() |
|
sample calculate |
a | b | | plus |
1 | 12 | | 13 |
| then result is |
sample calculate |
a | b | | plus |
1 | 12 | | 13 |
| with log | SetUp() PlusAB(1,12) TearDown() |
Errors are reported.
when test is⇓
story test fixture |
check | test result |
|
sample calculate |
a
This table is invalid for this fixture: No calculated columns.
| b |
1 | 2 |
|
|
| then result is |
sample calculate |
a
This table is invalid for this fixture: No calculated columns.
| b |
1 | 2 |
|
when test is⇓
story test fixture |
check | test result |
sample calculate |
a | b | | |
1 | 12 | | 13 |
|
sample calculate |
a
This table is invalid for this fixture: No expected columns.
| b | | |
1 | 12 | | 13 |
|
|
sample calculate |
a | b | | |
1 | 12 | | 13 |
| then result is |
sample calculate |
a
This table is invalid for this fixture: No expected columns.
| b | | |
1 | 12 | | 13 |
|
when test is⇓
story test fixture |
check | test result |
sample calculate |
a | b | | plus | garbage |
1 | 2 | | 3 | 4 |
|
sample calculate |
a | b | | plus | garbage
Member 'garbageab' with 2 parameter(s) not found for type 'fit.Test.Double.SampleCalculateFixture'.
|
1 | 2 | | 3 | 4 |
|
|
sample calculate |
a | b | | plus | garbage |
1 | 2 | | 3 | 4 |
| then result is |
sample calculate |
a | b | | plus | garbage
Member 'garbageab' with 2 parameter(s) not found for type 'fit.Test.Double.SampleCalculateFixture'.
|
1 | 2 | | 3 | 4 |
|
when test is⇓
story test fixture |
check | test result |
|
sample calculate
This table is invalid for this fixture: No header row.
|
|
|
| then result is |
sample calculate
This table is invalid for this fixture: No header row.
|
|
when test is⇓
story test fixture |
check | test result |
sample calculate |
a | b | | plus |
1 | 12 |
1 | 12 | | 13 |
1 | 12 | | 13 | 14 |
|
sample calculate |
a | b | | plus |
1
This table is invalid for this fixture: Row should be 4 cells wide.
| 12 |
1 | 12 | | 13 |
1
This table is invalid for this fixture: Row should be 4 cells wide.
| 12 | | 13 | 14 |
|
|
sample calculate |
a | b | | plus |
1 | 12 |
1 | 12 | | 13 |
1 | 12 | | 13 | 14 |
| then result is |
sample calculate |
a | b | | plus |
1
This table is invalid for this fixture: Row should be 4 cells wide.
| 12 |
1 | 12 | | 13 |
1
This table is invalid for this fixture: Row should be 4 cells wide.
| 12 | | 13 | 14 |
|
when test is⇓
story test fixture |
check | test result |
sample calculate |
a | | plus1 | double | void |
one | | um | oneone | one |
1 | | two | 11 | 1 |
|
sample calculate |
a | | plus1 | double | void |
one
Parse parameter 1 for 'fit.Test.Double.SampleCalculateFixture:Plus1A(1)' type System.Int32 failed.
| | um | oneone | one |
1 | | two
Input string..was not in a correct format.
| 11 | 1 expected void actual |
|
|
sample calculate |
a | | plus1 | double | void |
one | | um | oneone | one |
1 | | two | 11 | 1 |
| then result is |
sample calculate |
a | | plus1 | double | void |
one
Parse parameter 1 for 'fit.Test.Double.SampleCalculateFixture:Plus1A(1)' type System.Int32 failed.
| | um | oneone | one |
1 | | two
Input string..was not in a correct format.
| 11 | 1 expected void actual |
|