Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Create a new project in your favourite IDE (it can be a maven project)
  2. Create a new class called Timesheet in the package "tdd_with_fitnesse"
  3. Define the class as follows
  4. Code Block
    languagejava
    titleTimesheet fixture
    linenumberstrue
    package tdd_with_fitnesse;
    
    import java.text.NumberFormat;
    
    /**
     *
     * @author Selvyn
     */
    public class TimeSheet
    {
        public void setCheckInTime(String checkintime)
        {
        }
    
        public void setCheckOutTime(String checkouttime)
        {
        }
    
        public void setHourlyRate(String rate)
        {
        }
        
        public  String  CheckInTimeNormalized()
        {
    		return "";
        }
    
        public  String  CheckOutTimeNormalized()
        {
    		return "";
        }
    
        public String Pay()
        {
    		return "";
        }
    
        public  String  HoursWorked()
        {
    		return "";
        }
    
    
        //returns the number of hours worked
        public double calculateHoursWorked()
        {
        }
        
        public  void    execute()
        {
        } 
    }

    The execution order is as follows

    1. first all the setters are called in the order as they appear in the wiki
    2. then if an execute method is defined it is called (execute is optional)
    3. the get methods are called in the order as they appear in the wiki
  5. compile Compile and package the code into a jar (packaging is optional but makes deployment easier) into tdd_with_fitnesse_v2.jar, or point to the directory where the class files are.
  6. Go back to your FitNesse wiki page and run the test by pressing the "Test" button at the top right of the page.
  7. All the tests should fail.