Open
Conversation
…rs, Add count nights method and the minitest to
…or the date that we give and the method that calculate the cost of the reservatoin.
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 tested overlap? using all the examples we went over in class! Also the way you setup appropriate relationships between 4 different classes and made your own error class. Code Style Bonus AwardsWas the code particularly impressive in code style for any of these reasons (or more...?)
|
jmaddox19
reviewed
Mar 17, 2020
| end | ||
|
|
||
| def overlap?(other) | ||
| start_date < other.end_date && other.start_date < end_date |
| end | ||
| end | ||
|
|
||
| describe "overlap?" do |
Comment on lines
+6
to
+16
| if !(start_date.is_a? Date) || !(end_date.is_a? Date) | ||
| raise ArgumentError.new("If the start_date and end_date is not a Date") | ||
| end | ||
|
|
||
| if end_date < start_date | ||
| raise ArgumentError.new("If the start_date is biger then the end_date") | ||
| end | ||
|
|
||
| if start_date == end_date | ||
| raise ArgumentError.new("If the start_date date is same with end_date") | ||
| end |
Comment on lines
+26
to
+41
| it " Rais an argument ArgumentError if end_date is smaller then a start date" do | ||
| start_date = Date.today | ||
| end_date = Date.today - 3 | ||
| expect{Hotel::DateRange.new(start_date, end_date)}.must_raise ArgumentError | ||
| end | ||
|
|
||
| it "is an an error for negative-lenght ranges" do | ||
| start_date = Date.today -5 | ||
| end_date = Date.today | ||
| expect{Hotel::DateRange.new(start_date, end_date)}.must_raise ArgumentError | ||
|
|
||
| end | ||
|
|
||
| it "is an error to create a 0-length range" do | ||
| start_date = Date.today | ||
| end_date = Date.today |
There was a problem hiding this comment.
Love that you tested all this on the constructor!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Assignment Submission: Hotel
Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions.
Reflection