unclebob / fitnesse

FitNesse -- The Acceptance Test Wiki
fitnesse.org
Other
2.04k stars 715 forks source link

[Question] Is it possible to pass entire table as arrayList to fixture code? #1306

Open BigInspector opened 4 years ago

BigInspector commented 4 years ago

Hello. I am using Fitnesse Slim and I have the following table (I am newbie to Fitnesse):

|payment_date|amount | |2020-01-20 |-3987.55| |2020-02-20 |520.82 | |2020-03-20 |520.82 | |2020-04-20 |520.82 | |2020-05-20 |520.82 | |2020-06-20 |520.82 | |2020-07-20 |520.82 | |2020-08-20 |520.82 | |2020-09-20 |520.82 |

Basically what I need is to pass the entire table as list to fixture code and then calculate one value based on dates and amount. How this can be implemented?

fhoeben commented 4 years ago

You could use a Table Table in combination with your own fixture to get the entire table as list of lists and calculate what you need. But... where does the expected value go (i.e. the value to compare your calculated value with to see whether the tests passes or fails)? Maybe you need another column, or extra row at the end?