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) || |
| 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) |
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 |
| 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 |
| end | ||
| end | ||
|
|
||
| it "returns nil for a nonexistent reservation" do |
test/hotel_system_test.rb
Outdated
| end | ||
| end | ||
|
|
||
| describe "available_rooms_in_block method" do |
There was a problem hiding this comment.
Minor nitpick: This should probably be named something else
There was a problem hiding this comment.
oh, I missed this line. It should be "reserve_room for rooms in block"
Hotel
Congratulations! You're submitting your assignment!
Comprehension Questions