|daily fine?|grace period?|checkout period?| |10|3|20|
dailyFine() gracePeriod() checkoutPeriod()
package fixtures; import com.frisco.library.*; import fit.*; public class BookRules extends ColumnFixture { public int dailyFine() { return new Book().getCheckoutConstraints().getCentsPerDay(); } public int gracePeriod() { return new Book().getCheckoutConstraints().getGracePeriod(); } public int checkoutPeriod() { return new Book().getCheckoutConstraints().getPeriodAsDays(); } }
Create a Test in a Fitnesse Wiki Page
1. In your browser, go to http://localhost to get to Fitnesse Frontpage.
2. Create a new testing page by appending the page name to the URL, i.e., http://localhost/LibraryTests
3. You should see a webpage with a banner reading Not Found ... and a small link to Create this Page. Click the link.
4. In the new webpage, add the path to the classes required for the tests.
For me this is - C:\Documents and Settings\GHELTON1\src\fitnesse\Library\bin and add the tests that execute the methods in the fixture class in the form shown below:
!path C:\Documents and Settings\GHELTON1\src\fitnesse\Library\bin
!|fixtures.BookRules| |daily fine?|grace period?|checkout period?| |10|3|21|
Modify Properties Click on the Properties link in the left hand panel to edit the page properties. In the Properties dialog, click the Test property and Save.
Test! Click the Test link in the left hand column to perform the tests. The tests that pass will be colored with a green tint and those that fail will be highlighted with a reddish tint.
Conclusion
For more info about tests and options to run them, see http://www.ibm.com/developerworks/java/library/j-cq02286/index.html
Different types of fixtures identified and discussed http://fit.c2.com/wiki.cgi?FieldGuideToFixtures
Ron Jeffries how-to - http://www.xprogramming.com/xpmag/dbcAcceptance.htm