Skip to content

Conversation

@jetabajrami
Copy link

@jetabajrami jetabajrami commented Mar 9, 2020

Assignment Submission: Hotel

Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions.

Reflection

Question Answer
What was a design challenge that you encountered on this project? I create Room class in my project, I think that i didn’t need and sometimes i had extra difficult on test writing
What was a design decision you made that changed over time over the project? I add the the Room class later one, also i delete some attribute that i gave to some class, for example id for reservation.
What was a concept you gained clarity on, or a learning that you'd like to share? An example of a nominal test in my code is: creating instances of Room or Reservation.
What is an example of a nominal test that you wrote for this assignment? What makes it a nominal case? An example of a nominal test in my code is: creating instances of Room or Reservation.
What is an example of an edge case test that you wrote for this assignment? What makes it an edge case? Example of an edge case test that I wrote is if end_date is greater than start date.
How do you feel you did in writing pseudocode first, then writing the tests and then the code? Was not easy but, helped me a lot to understand more about what i am passing to one method and what I want from that method to get.

@jmaddox19
Copy link

Hotel

Section 1: Major Learning Goals

Criteria yes/no, and optionally any details/lines of code to reference
Practices SRP by having at least two separate classes with distinct responsibilities, and test files for these two classes ✔️
Overall, demonstrates understanding instance variables vs. local variables. (There aren't unnecessarily too many instance variables, when it should be a local variable) ✔️
For each test file, tests demonstrate an understanding of instantiating objects properly, and using Arrange-Act-Assert ✔️
Practices pseudocode and TDD, and reflected on it by filling out the reflection questions ✔️
Practices git with at least 15 small commits and meaningful commit messages ✔️

Section 2: Code Review and Testing Requirements

Criteria yes/no, and optionally any details/lines of code to reference
There is a class that represents a reservation, and a second class that holds/manages a collection of reservations through composition (instance variable) ✔️
The logic for checking if a reservation's date overlaps with another reservation's date is complex logic that is separated into method(s) (and potentially class(es)) ✔️
The logic for checking if a reservation's date overlaps with another reservation's date has unit tests ✔️
All of the given tests run and pass ✔️
A test coverage tool is installed and used, and shows 95% test coverage ✔️

Section 3: Feature Requirements

Feature Requirement: There is a method that... yes/no
gives back a list of rooms, and it's tested ✔️
creates a specific reservation for a room for a given date range, and it has nominal test cases ✔️
creates a specific reservation for a room for a given date range, and it tests an edge case, such as no available room, or invalid date range ✔️
gives back a list of reservations on a given date. Its tests include a test that makes several reservations for a given date ✔️
calculates the total price for a reservation ✔️
gives back a list of available rooms for a given date range, and it has nominal test cases ✔️
gives back a list of available rooms for a given date range, and it has edge test cases, such as no available room, or invalid date range
creates a block of rooms
reserves a room from a block

Overall Feedback

Overall Feedback Criteria yes/no
Green (Meets/Exceeds Standards) 14+ total in all sections ✔️
Yellow (Approaches Standards) 9-13 total in all sections
Red (Not at Standard) 0-8 total in all sections, or assignment is breaking/doesn’t run with less than 5 minutes of debugging

Additional Feedback

Great 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 Awards

Was the code particularly impressive in code style for any of these reasons (or more...?)

Quality Yes?
Perfect Indentation
Elegant/Clever
Descriptive/Readable
Concise
Logical/Organized

end

def overlap?(other)
start_date < other.end_date && other.start_date < end_date

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very clever!

end
end

describe "overlap?" do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great test coverage!

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great validation here!

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love that you tested all this on the constructor!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants