Here is an example of a table used to describe when a card is selected. A card is accepted only if it matches all of the examples.
exampler.fitlibrary.AndFilterFixture | exampler.fitlibrary.exampleFixtures.CardFixture | ||
description | example | counterexample | |
the right manufacturer | Bicycle, Bingo | Zed | |
the right color | red | black | |
the number is prime | 2, 3, 5, 7 | 4, Ace, Queen | |
the card is unrumpled | yes | no |
The following table is an expansion of the previous one.
exampler.fitlibrary.exampleFixtures.CardFixture | ||||
the right manufacturer | the right color | the number is prime | the card is unrumpled | result() |
Zed | red | 2 | yes | false |
Bicycle | black | 3 | yes | false |
Bingo | red | 4 | yes | false |
Bicycle | red | Ace | yes | false |
Bingo | red | Queen | yes | false |
Bicycle | red | 5 | no | false |
Bicycle | red | 2 | yes | true expected false actual |
Bingo | red | 3 | yes | true expected false actual |
Bicycle | red | 5 | yes | true expected false actual |
Bingo | red | 7 | yes | true expected false actual |
Here, a card is accepted if it matches any of the examples.
exampler.fitlibrary.OrFilterFixture | exampler.fitlibrary.exampleFixtures.CardFixture | ||
description | example | counterexample | |
the right manufacturer | Bicycle, Bingo | Zed | |
the right color | red | black | |
the number is prime | 2, 3, 5, 7 | 4, Ace, Queen | |
the card is unrumpled | yes | no |
The following table is an expansion of the previous one.
exampler.fitlibrary.exampleFixtures.CardFixture | ||||
the right manufacturer | the right color | the number is prime | the card is unrumpled | result() |
Bicycle | black | 4 | no | true expected false actual |
Bingo | black | Ace | no | true expected false actual |
Zed | red | Queen | no | true expected false actual |
Zed | black | 2 | no | true expected false actual |
Zed | black | 3 | no | true expected false actual |
Zed | black | 5 | no | true expected false actual |
Zed | black | 7 | no | true expected false actual |
Zed | black | 4 | yes | true expected false actual |
Zed | black | 4 | no | false |
Zed | black | Ace | no | false |
Zed | black | Queen | no | false |
If all of the categories to check have yes/no true/false values, you don't need to give the examples and counterexamples.
exampler.fitlibrary.OrFilterFixture | exampler.fitlibrary.exampleFixtures.CardFixture | ||
description | |||
the card is unrumpled | |||
the card is face up |
The following table is an expansion of the previous one.
exampler.fitlibrary.exampleFixtures.CardFixture | ||
the card is unrumpled | the card is face up | result() |
true | false | true expected false actual |
false | true | true expected false actual |
false | false | false |
You can mix and match explicit and default values, but that's probably more trouble than it's worth because, at least for the moment, you have to make the description column span the row. (That way, the fixture can distinguish between an omitted value and an intentional null value.)
exampler.fitlibrary.OrFilterFixture | exampler.fitlibrary.exampleFixtures.CardFixture | |
description | example | counterexample |
the card is unrumpled | ||
the number is prime | 2, 3, 5, 7 | 4, Ace, Queen |
The following table is an expansion of the previous one.
exampler.fitlibrary.exampleFixtures.CardFixture | ||
the card is unrumpled | the number is prime | result() |
true | 4 | true expected false actual |
false | 2 | true expected false actual |
false | 3 | true expected false actual |
false | 5 | true expected false actual |
false | 7 | true expected false actual |
false | 4 | false |
false | Ace | false |
false | Queen | false |