-
Notifications
You must be signed in to change notification settings - Fork 40
Time - Lola #38
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: design-scaffolding
Are you sure you want to change the base?
Time - Lola #38
Conversation
…by_date method to answer wave 2 questions.
… room and storing a reservation
…om, rervervation_by_date and available_room. passed wave 1 and 2
| end_date = @range.end_date | ||
| test_range = Hotel::DateRange.new(start_date, end_date) | ||
|
|
||
| expect(@range.overlap?(test_range)).must_equal true |
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 test for a single test case. The test cases below also need to be completed to insure that .overlap? returns the correct value for the different situations described below.
| @date = Date.parse("2020-08-04") | ||
| end | ||
| describe "wave 1" do | ||
| describe "rooms" 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.
You should keep this test to ensure that a hotel_controller has an array of rooms.
|
|
||
| def reservations(date) | ||
| return [] | ||
| def initialize() |
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 constructor looks great. Make sure to include a test that check that the class is set up correctly.
| end | ||
| end | ||
| describe "reserve_room" do | ||
| it "takes two Date objects and returns a 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.
This is a good test. Nice work! You also need to test edge cases. What if there is no room available?
| room_number = 7 | ||
| rate = 200 | ||
| reservation = Hotel::Reservation.new(start_date, end_date, room_number, rate) | ||
| expect(reservation.cost).must_be_kind_of Numeric |
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.
In addition to checking that cost is Numeric you should check that it is the correct value.
| return [] | ||
| # Wave 1 | ||
| # creates a reservation of a room for a given date range | ||
| def reserve_room(start_date, end_date, room_number, rate) |
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 work implementing this complex logic. To fully tie together reserve_room and available_rooms, ideally reserve_room would not take a room_number as an argument, but instead find an available room by using the available_rooms method.
| Raise more exceptions to account for user input error | ||
| I would consider trying to make more helper methods | ||
| Save the reservations and it's room number in a array of hashes | ||
| Get better at writing tests |
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.
Your tests look great! However, you need more of them.
| I would consider trying to make more helper methods | ||
| Save the reservations and it's room number in a array of hashes | ||
| Get better at writing tests | ||
| Understand how to get the program to pass 95% test coverage |
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.
By clicking on the file name in the index.html file in the coverage directory, you can see which lines of code weren't tested.
| end | ||
|
|
||
| xdescribe "include?" do | ||
| describe "include?" 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.
The tests below should be completed. This will bring up you test coverage for DateRange
HotelSection 1: Major Learning Goals
Section 2: Code Review and Testing Requirements
Section 3: Feature Requirements
Overall Feedback
Additional 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! I am particularly impressed by the way that you worked through complex logic to create helper methods such as I do see some room for improvement around writing comprehensive tests that test multiple nominal and edge cases. I recommend using the coverage report to identify lines of code that haven't been tested. If you're not sure how to address these lines of code, talk to an instructor or TA. Keep up the hard work! Code Style Bonus AwardsWas the code particularly impressive in code style for any of these reasons (or more...?)
|
Assignment Submission: Hotel
Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions.
Reflection