I have the following program in Pharo: 2 classes Yacht and YachtRental, Test Class and YachtRental test. I need to implement the following: on the 4th day, the customer gets discount = 10 % on the daily rate. Here is my code:
I need to implement the following: on the 4th day, the customer gets discount = 10 % on the daily rate. Here is my code:
| yachtRental myCruise |
yachtRental := YachtRental new.
myCruise := Yacht cruise.
self assert: (yachtRental priceFor: myCruise days: 4) = 890
Basically, I need to be able to implement the discount of 10 % here, however there is a message "Using assert:equals: produces better context on rule failure", could you please help me explain what is wrong with it.