tags:

views:

238

answers:

1

Bear with me guys because I don't know how to start things up using fitNesse framework.

okay here's where I need help, upon running the test I want to capture the string or the fitnesse scripts being placed in the fitnesse textarea and then a certain function will then parse the scripts to replace the strings I want to replace. For example, I'd like to replace all the 'today' text in the scipts with the real DateTime today.

actually my purpose of doing this its because not only using it in parsing 'todays date' but instead including parsing tomorrow, yesterday and a 'basedate' variable at the top of each test. Much of its use will be on assigning the 'basedate' functionality.

I then created a class named 'DateFunctions' which parses the text in the text area not just looking for the 'today' keyword but also including parsing tomorrow, yesterday

my new question will be, is my new implementation below makes sense or is correct perhaps? and is there a way on how to debug C# codes in fitnesse?

public class RowFixtureBase : fit.RowFixture
    {
        public virtual void setBaseDate(String basedate)
        {
            if (!DateFunctions.SetBaseDateTo(basedate))
            {
                throw new ArgumentException();
            }
        }

        public override void DoRow(fit.Parse rows)
        {
            foreach (fit.Parse row in new fitlibrary.ParseEnumerator(rows))
            {
                fit.Parse newrow = new fit.Parse(DateFunctions.EvaluateDate(row.Text));
                base.DoRow(newrow);
            }
        }

     //more codes here that is irrelevant to the question
    }
A: 

With the latest versions of FitNesse, you should be able to use !today as markup in the FitNesse page. So your specific example may already be implemented for you.

http://fitnesse.org/FitNesse.UserGuide.TodaysDate

Lee
that's great! i didn't know that but still its short on some of the functionality that i need.please see my edited question above. thanks again!
grayman