mercredi 28 octobre 2015

unit testing occurs_on? method.

I am not sure on how to go about on testing this occurs_on? method. I know it provides a true or false response. I've used an empty? method before for unit testing on a different project, but this one truly has me confused. This is occurs on method in my class.

def occurs_on?(the_year, the_month, the_day)
    return @year == the_year &&
         @month ==the_month &&
         @day == the_day
  end
end

Thus so far, here is what the unit testing for this class consist off. I know we are to include the method within the test. No errors nor failures. I'm just trying to gain a way to format the occurs on.

def test_3
    appointment = OneTimeAppointment.new("New York City", "Root Canal", 2015, 12, 27, 5, 45)
    assert_equal "New York City Root Canal 2015 12 27 05:45", appointment.to_s

  end

Aucun commentaire:

Enregistrer un commentaire