Quin and Olga - Time #15
Conversation
beccaelenzil
left a comment
There was a problem hiding this comment.
Good work overall. It is clear that the learning goals around object composition and inheritance were met. You've done a great job working with this concepts and implementing some tricky logic. I've left some inline comments for you to review. This comments largely focus on writing tests that fully test nominal and edge cases for all of your methods. Please let me know if you have any questions and we can set up a group chat. Keep up the hard work.
|
|
||
| def find_driver(id) | ||
| Driver.validate_id(id) | ||
| return @drivers.find { |driver| driver.id == id } |
There was a problem hiding this comment.
good use of an enumerable method.
|
|
||
|
|
||
| total = @passenger.total_time_spent | ||
| expect(total).must_be_instance_of Float |
There was a problem hiding this comment.
It can be good to check that the return value is the correct datatype, but it is even more important to check that it is the correct value.
|
|
||
|
|
||
| total = @passenger.net_expenditures | ||
| expect(total).must_be_instance_of Integer |
There was a problem hiding this comment.
It can be good to check that the return value is the correct datatype, but it is even more important to check that it is the correct value.
| @@ -69,6 +70,65 @@ | |||
| end | |||
|
|
|||
| describe "net_expenditures" do | |||
There was a problem hiding this comment.
The tests for net_expenditures and total_time_spent should test the edge cases of a passenger having no trips an incomplete trips.
| @trips << trip | ||
| end | ||
|
|
||
| def average_rating |
There was a problem hiding this comment.
Incomplete trips should not be including in the calculations of average_rating or total_revenue
|
|
||
|
|
||
|
|
||
| describe "request trip" do |
There was a problem hiding this comment.
These tests look good! It looks like you implemented some of the optional conditions for choosing a driver. It is important to test these as well.
OO Ride ShareMajor Learning Goals/Code Review
Testing Requirements
Overall Feedback
Code Style Bonus AwardsWas the code particularly impressive in code style for any of these reasons (or more...?)
|
Assignment Submission: OO Ride Share
Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions.
Reflection