Hi Mike,
thanks for the suggestion, but as I read it you are saying that I won't get a
generic solution by attempting my own row handling this way.
Did I see somewhere that the use of expressions like !today+x has been included
in the latest FitNesse? This is moving towards what I am trying to achieve, but
I don't find that !today is often very useful as a test date (my test doesn't
know what it is or what it it relates to..).
As I do a lot of testing around fixed dates (the UK tax year, for instance, ends
on 5th April - don't ask why) I wanted to be able to set a reference date, then
hang all the other test dates off that.
A full test of a tax year would really entail 2 tax year ends, covering,
including setup and tidying up, about 16 months. I could hard-code a date onto
each test page in my cycle, but I would much rather set a date once and have it
roll forward. Then, for instance, if I wanted to test a different tax year, I
only change one date.
Is there a more general discussion to be had here around the re-usability of
date based tests?
Anyway, so I have a C# function that can cope with expressions like
basedate+/-ax[+/-bx][+/-cx] etc. where abc are numeric and x is one of [ymwd].
The plan was then, originally, to have something like this, where the code does
a search and replace for "basedate":
!define babyduedate {24/08/2009}
!|myNameSpace.myTest|
|set basedate to|${babyduedate}|
|check|maternity pay available from|basedate-11w|
|check|maternity pay payable to|basedate+39w|
Or perhaps this, which would entail a slightly more interesting search
algorithm:
!define babyduedate {24/08/2009}
!|myNameSpace.myTest|${babyduedate}|
|check|maternity pay available from|${babyduedate}-11w|
|check|maternity pay payable to|${babyduedate}+39w|
I hope that makes sense.
So...would a cell operator be of more use to me (and what is a cell operator
anyway!)?
Thanks,
Tom.
--- In fitnesse@yahoogroups.com, Mike Stockdale <jediwhale@...> wrote:
>
> The problem with your first attempt is it tries to parse the HTML for a
> set of rows, and the parser expects a full table. That's why it says
> 'missing table tag'. The problem with the second attempt is that you
> need to modify the body of each cell, you can't modify the body of the rows.
>
> So you could do something like:
> for each row in rows
> for each cell in row
> cell.SetBody(doStuff.modify(cell.Body)
>
> However, you will have problems with some of the flow fixture types that
> override DoTable and don't call DoRows as they handle the navigation of
> the table structure in their own special way.
>
> What are you specifically trying to accomplish? There may be a better
> approach, perhaps using cell operators.
> --
> Cheers,
> Mike Stockdale
>
> /fit/Sharp <http://www.syterra.com/FitSharp.html>
> FitNesse.NET <http://www.syterra.com/FitnesseDotNet.html>
> Syterra Software Inc. <http://www.syterra.com>
>