-
Notifications
You must be signed in to change notification settings - Fork 49
Leaves - Katie #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Leaves - Katie #40
Conversation
git status
HotelWhat We're Looking ForTest Inspection
Code Review
Overall FeedbackYou're off to a good start! You've built your first project with minimal starting code. This represents an incredible milestone in your journey, and you should be proud of yourself! I am particularly impressed by the way that you broke down complicated logic into helper methods. This is particularly evident in the methods you wrote for the I do see some room for improvement around putting all the pieces together so that they all work together. You wrote solid methods for checking for valid reservations, but these were never invoked. When we refactor in a couple weeks, I am excited to see how you can bring all the pieces together to meet all the requirements of Waves 1 and 2. |
| return @reservations | ||
| end | ||
|
|
||
| # def self.find(date_range_object) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented code before turning in.
| RATE = 200.0 | ||
|
|
||
| def initialize room_num = nil | ||
| unless room_num.to_i > 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good use of an ArgumentError
| end | ||
|
|
||
| def create_reservation(room_num: nil, start_date: start_date, end_date: end_date, rate: nil) | ||
| #reservation_validation(start_date, end_date) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a useful method. Why don't you use it?
| @reservations << new_reservation | ||
| end | ||
|
|
||
| def reservation_validation(start_date, end_date) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a useful method, and makes good use of the overlap_check method from Reservation_Date. You are on the right track.
| end | ||
| end | ||
|
|
||
| # def reservation_check_all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed unused code.
|
|
||
| it "Checks for a Valid Date" do | ||
| expect { | ||
| Hotel::Reservation_Date.new("2019-02-30", "2001-02-03") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider storing these dates in variables to separate our Arranging, Acting, and Asserting
| @@ -0,0 +1,93 @@ | |||
| require_relative 'test_helper' | |||
|
|
|||
| describe "Date" do | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this file is a suite of tests for Reservation_Date give it the title reservation_date_test
| }.must_raise ArgumentError | ||
| end | ||
|
|
||
| it "Calculates Date Range (Num of Nights)" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great set of tests! You also need this when you're creating a reservation.
Hotel
Congratulations! You're submitting your assignment!
Comprehension Questions