Fitnesse and Excel

This took me waaaaay too long to find, but I think it will work.  Let’s say you have an Excel sheet that you want to output from an application, and you want to use Fitnesse to test.  What fixture do you use?  I initially figured RowFixture or ColumnFixture, but neither is actually the right fit for that situation.  Nor are DoFixture or ArrayFixture, because you’re not working with objects per se.  Really you want a test table that acts like a plain table of values, which would seem to suggest, going on name alone, TableFixture.  That, however, is not the right answer either – TableFixture is meant for free-form testing; “Table” is meant as a genericizing prefix.

My current approach is to use a CombinationFixture.  This fixture works pretty simply: You put your “x” values across the top and your “y” values along the side.  For an Excel testing situation, call the top values Column Number and the side values Row Number.  You end up with something like this:

1 2 3
1 abc 123 !
2 def 098 &
3 GHI 768 $

Which correlates to an Excel sheet that looks like this:

abc 123 !
def 098 &
GHI 768 $

This may not work for everything, but it seems like the best option I’ve found.

This entry was posted in Uncategorized.