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

Shaunna Wiens --carets #36

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

Shaunna Wiens --carets #36

wants to merge 28 commits into from

Conversation

skwiens
Copy link

@skwiens skwiens commented Sep 11, 2017

Hotel

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
Describe a design decision you had to make when working on this project. What options were you considering? What helped you make your final decision? One design decision I had to make when working on this project is which classes to make. One option I was considering was making two classes: reservations and rooms. In the end I decided to make a hotel class as well as Pricing class. If I were to do it again, I wouldn't include the pricing class, but it seemed as though it would be the same amount of work to move it now or later, so according to the idea in the book I left it where it was. Ultimately, I think the hotel has too many responsibilities according to good OOD, but it helped keep the other classes simpler.
Describe a concept that you gained more clarity on as you worked on this assignment. As I worked on this assignment I gained more and less clarity on testing. I gained more clarity on red, green, refactor as a process and how to write in that order. I gained less clarity (or rather ran into more difficulties) as to how to test certain aspects of my program. I gave up on testing the CLI through tests and took it's spec out of the loop by changing the file name.
Describe a nominal test that you wrote for this assignment. A nominal test that I wrote for this assignment was the ability to access the attr_readers correctly.
Describe an edge case test that you wrote for this assignment. Some edge case tests that I wrote were to not allow a user to use invalid dates such as checking in before today or checking out the day of the check in or before.
How do you feel you did in writing pseudocode first, then writing the tests and then the code? Most of the times I wrote out tests and then code. I don't think I did great at writing out pseudocode, but many times I would write the description portion of my tests followed by a test and then code to match. The description of my test is somewhat like pseudocode.

@CheezItMan
Copy link

CheezItMan commented Sep 12, 2017

Hotel

What We're Looking For

Feature Feedback
Baseline
Used git regularly Good number of commit and good messages.
Answer comprehension questions Check, I agree with you about Pricing and Hotel. Testing the CLI isn't something you can do without using a Mocking tool, which we won't use for now.
Design
Each class is responsible for a single piece of the program Pretty good separation, I like the reservation class with an include_date? method. The Pricing class looks more like a method for a room instead of a class by itself.
Classes are loosely coupled Fairly loosely coupled, but Hotel is doing a huge amount of the work.
Wave 1
List rooms Check, well done
Reserve a room for a given date range Check
List reservations for a given date Check
Calculate reservation price Check, pricing class
Invalid date range produces an error Well done, methods to produce the checks make things a bit more readable.
Wave 2
View available rooms for a given date range Check
Reserving a room that is not available produces an error Check
Wave 3
Create a block of rooms Interesting choice that the block includes a list of rooms.
Check if a block has rooms Check via rooms_in_block
Reserve a room from a block Check
Test coverage 99.75%!!
Additional Feedback Nicely done! In your testing for Block you should include testing for things such as invalid dates at the Block class level because the class might be reused elsewhere. Also in your testing, what about when you try to reserve a room with an invalid room #? Good edge case testing to see if you can reserve a room on the day someone is checking out. For testing the uniqueness of the block booking you can make a hash of all the booking IDs and loop through counting how often they occur as the value. Then if all the values are 1, they're unique. Because they're random there's no way to verify it 100%, but you could run the test several times. For returns 17 rooms when there are three room conflicts you can also just verify that the available rooms don't include the rooms in the specific reservations. Overall you did really really well. The design was good, although as you noted, not perfect. You also did a very through job testing.

Copy link

@CheezItMan CheezItMan left a comment

Choose a reason for hiding this comment

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

Nicely done, just a few in-code comments.

lib/hotel.rb Outdated
def get_available_rooms(date_begin, date_end)
available_rooms = @rooms.clone

@reservations.each do |res|

Choose a reason for hiding this comment

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

This type of loop looks repeated, maybe you could turn that into a helper method.

# raise StandardError.new "this room doesn't exist"
# end

def assign_id

Choose a reason for hiding this comment

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

I'm not sure what purpose this method serves, why make the block Ids random?

end
end

it "creates 20 hotels that can identify their room numbers" do

Choose a reason for hiding this comment

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

This is probably too specific as to the implementation of the rooms, like that they are in order. Maybe just test that rooms must include a room with each id.

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