Skip to content
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

Branches - Michaela #38

Open
wants to merge 35 commits into
base: master
Choose a base branch
from
Open

Branches - Michaela #38

wants to merge 35 commits into from

Conversation

michaela260
Copy link

Hotel

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
What was a design challenge that you encountered on this project? It was really challenging to know how to structure blocks vs. reservations and whether one should be a subclass of the other. It was also challenging to not let my classes have too many dependencies.
What was a design decision you made that changed over time over the project? Originally I thought the room class would hold info about its cost, but I changed that because the same room can have different costs depending on block status.
What was a concept you gained clarity on, or a learning that you'd like to share? I'm much more comfortable using keyword and optional arguments now; it was helpful for some parameters to have default values. I also feel more confident about writing tests - I'm proud of the 100% coverage!
What is an example of a nominal test that you wrote for this assignment? What makes it a nominal case? A nominal test was that the 'make_reservation' method creates a new instance of Reservation. It's nominal, because it should always be true and relevant whenever any reservation is created.
What is an example of an edge case test that you wrote for this assignment? What makes it an edge case? An edge case test for 'make_reservation' was that it raises an ArgumentError if no rooms are available. This is an edge case because it's a more rare scenario and has a different outcome than usual.
How do you feel you did in writing pseudocode first, then writing the tests and then the code? At first, I did this really well, up through wave 2. Then in wave 3 I mostly wrote the code first unfortunately.

…mber' are included as parameters and are no longer randomly assigned
…ed 'find_room', 'find_reservation', and 'list_of_available_rooms_by_date' methods
…able rooms; also added tests for 'list_of_available_rooms_by_date', 'find_room', and 'find_reservation' methods
@tildeee
Copy link

tildeee commented Sep 17, 2019

Hotel

What We're Looking For

Test Inspection

Workflow yes / yes but no test / no
Wave 1
List rooms yes
Reserve a room for a given date range yes
Reserve a room (edge case) yes
List reservations for a given date yes
Calculate reservation price yes
Invalid date range produces an error yes
Test coverage yes
Wave 2
View available rooms for a given date range yes
Reserving a room that is not available produces an error yes
Test coverage yes
Wave 3
Create a block of rooms yes
Check if a block has rooms yes
Reserve a room from a block yes
Test coverage yes

Code Review

Baseline Feedback
Used git regularly yes
Answer comprehension questions yes
Design
Each class is responsible for a single piece of the program yes
Classes are loosely coupled yes
Fundamentals
Names variables, classes and modules appropriately yes
Understanding of variable scope - local vs instance yes
Can create complex logical structures utilizing variables yes
Appropriately uses methods to break down tasks into smaller simpler tasks yes
Understands the differences between class and instance methods yes
Appropriately uses iterators and Enumerable methods yes
Appropriately writes and utilizes classes yes
Appropriately utilizes modules as a namespace yes
Wrap Up
There is a refactors.txt file yes
The file provides a roadmap to future changes yes

Overall 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!

Your code is well-written! I think that your tests are well-written and cover all of the cases with all of the appropriate details. Your tests are really a great standard! Your implementation is also clean and logical and has elegant code style. A lot of your design is really thoughtful; from the big ideas of classes and their coupling, to also the details like optional arguments. Really great work!

I've found some areas in which I could imagine you to refactor if you had more time in this project... a lot of these are small areas that I think could be more concise; they're generally minor suggestions.

Overall, you did a great job on this! Great work!

raise ArgumentError.new "Error! You entered an invalid room number: #{room_number_to_search}"
end

return @list_of_all_rooms.find { |room| room.room_number == room_number_to_search }
Copy link

Choose a reason for hiding this comment

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

Nice! This whole method is perfect!

raise ArgumentError.new "Error! You entered an invalid reservation number: #{reservation_number_to_search}"
end

return @list_of_all_reservations.find { |reservation| reservation.reservation_number == reservation_number_to_search}
Copy link

Choose a reason for hiding this comment

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

Hm, I think that this method could be refactored to not use indicator, but to utilize what .find does if no match is found.


def list_of_available_rooms_by_date(date_to_check: )
unavailable_room_numbers = list_of_reservations_by_date(date_to_search: date_to_check).map do |reservation|
reservation.room_number
Copy link

Choose a reason for hiding this comment

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

the code in this method looks good-- It may be interesting to see if Reservations can reference Rooms so that getting the instance of Room doesn't take so much work heh, or refactor the below loops so that that finding the available rooms doesn't take so much work. (I don't have any suggestions right now, sorry :) )

end
end

it "raises an ArgumentError if given an invalid collection of room numbers" do
Copy link

Choose a reason for hiding this comment

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

This is great!

return true
else
return false
end
Copy link

Choose a reason for hiding this comment

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

Minor: Consider refactoring syntax like this to:

return date >= @start_date && date < @end_date

return false
else
return true
end
Copy link

Choose a reason for hiding this comment

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

Minor: Consider refactoring this to:

return !possible_room_numbers.empty?

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