-
Notifications
You must be signed in to change notification settings - Fork 49
Branches - Eve #34
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?
Branches - Eve #34
Conversation
…m class and add tests
…eservation method for HotelSystem class
…r HotelSystem class
HotelWhat We're Looking ForTest Inspection
Code Review
Overall FeedbackGreat work overall! 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! Eve, your submission for this project is fantastic-- your code is clean, intentional, well-thought out, and planned. Your attention to detail (like checking that reservation cost comes back as a formatted string) really shines in this project. Your naming of methods and variables, ease of Enumerables methods, and clean code-style show me how much you know! Also, the way your classes are organized, and your best practices like Above all, your tests are amazing! I'm really happy with how well-written your tests are. They cover things accurately and thoroughly, and are so easy to read. I think you did a great job with the tests! I hope you continue to write great tests like this! I have some small minor suggestions and comments on your code. Also, just as an FYI, about IDs: when we get to Rails, let's see what our strategy will be about giving IDs to objects when we save them in a database! Just something to look forward to :) Overall, you did a great job on this project. Keep up the great work! |
| @end_date = input_end_date | ||
| current_time = Date.today() | ||
|
|
||
| if (@start_date < current_time) || |
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.
Nice touch!
| blocked_rooms = find_overlapping_rooms_in_hotel_blocks(date_range) | ||
| available_rooms = @rooms.select do |number| | ||
| !has_overlapping(@room_reservation_data[number], date_range) && | ||
| !blocked_rooms.include?(number) |
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 select is clever!
test/hotel_system_test.rb
Outdated
| start_date2 = @end_date | ||
| end_date2 = start_date2 + @duration | ||
| @hotel_system.make_reservation(start_date2, end_date2) | ||
| expect (@hotel_system.reservations.length).must_equal @number_of_reservations + 1 |
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.
Nice case to test!
| start_date = Date.parse(start_date_data[index]) | ||
| end_date = Date.parse(end_date_data[index]) | ||
| @hotel_system.make_reservation(start_date, end_date) | ||
| end |
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.
Nice! This is a clean setup step!
| end | ||
| end | ||
|
|
||
| it "returns nil for a nonexistent reservation" 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!
test/hotel_system_test.rb
Outdated
| end | ||
| end | ||
|
|
||
| describe "available_rooms_in_block method" 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.
Minor nitpick: This should probably be named something else
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.
oh, I missed this line. It should be "reserve_room for rooms in block"
Hotel
Congratulations! You're submitting your assignment!
Comprehension Questions