Skip to content

Ports - Stephanie#33

Open
smarchante1 wants to merge 18 commits intoAda-C11:masterfrom
smarchante1:master
Open

Ports - Stephanie#33
smarchante1 wants to merge 18 commits intoAda-C11:masterfrom
smarchante1:master

Conversation

@smarchante1
Copy link
Copy Markdown

Hotel

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
What was a design challenge that you encountered on this project? One major challenge I had was deciding if I wanted to keep a date range class that I originally had. I ended up removing it and think that might not have been the best decision.
What was a design decision you made that changed over time over the project? Initially I wanted to store block reservations in my main Reservation Manager class. I changed this to storing block reservations in a hotel block class.
What was a concept you gained clarity on, or a learning that you'd like to share? I have a better understanding of how classes can interact with one another through the methods that are created in each class. This also made the project quite challenging.
What is an example of a nominal test that you wrote for this assignment? What makes it a nominal case? A nominal test I wrote was making sure a reservation was added to the list of reservations.
What is an example of an edge case test that you wrote for this assignment? What makes it an edge case? An edge case I wrote was checking to make sure a check out date wasn't before a check_in date.
How do you feel you did in writing pseudocode first, then writing the tests and then the code? I really enjoyed this workflow. It helped me to get a better understanding of the methods I needed, and then slowly work towards writing them.

@CheezItMan
Copy link
Copy Markdown

Hotel

What We're Looking For

Feature Feedback
Baseline
Used git regularly Good number of commits and good commit messages
Answer comprehension questions Check
Design
Each class is responsible for a single piece of the program For what's been done yes.
Classes are loosely coupled Check
Wave 1
List rooms Check
Reserve a room for a given date range Check
List reservations for a given date Check
Calculate reservation price Check, but see my inline notes, the if statement is... odd
Invalid date range produces an error Check
Test coverage 88.44% coverage :(
Wave 2
View available rooms for a given date range Missing
Reserving a room that is not available produces an error Missing
Wave 3
Create a block of rooms Missing
Check if a block has rooms Missing
Reserve a room from a block Missing
Fundamentals
Names variables, classes and modules appropriately See my inline notes for some of your method names.
Understanding of variable scope - local vs instance Check
Can create complex logical structures utilizing variables Check
Appropriately uses methods to break down tasks into smaller simpler tasks Check, for what was done
Understands the differences between class and instance methods Only instance methods here.
Appropriately uses iterators and Enumerable methods Very few examples of Enumerable methods here.
Appropriately writes and utilizes classes Check
Appropriately utilizes modules as a namespace Check
Wrap Up
There is a refactors.txt file Check
The file provides a roadmap to future changes It's starting to
Additional Feedback As we noted in a 1-on-1, this was a rough project for you. Not a great outcome, but you had the bones of a great project here. You had good classes and a good rough outline of your design. Unfortunately it wasn't implemented and that's unfortunate. Take a look at my feedback and ask me questions if something is unclear. This is a tough industry, but you do have the talent to be very successful here. Don't let what other people say distract you. You can make a great impact here! If you are feeling down and upset please talk to me, Sarah or Dee and let us support you!

expect(@reservations.length).must_equal(1)
end

it "raises an error if the room is not available" do
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your room here is still available so the ArgumentError is not being raised. This is a good start on testing the double-book issue.

# unless room_availability(date_range.check_in, date_range.check_out).include?(room)
# raise ArgumentError, "The room you've selected is not available for these dates."
# end
reservation = Hotel::Reservation.new(room, date_range)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No check that the room is already reserved.

Comment thread lib/date_range.rb
def initialize(check_in, check_out)
@check_in = check_in

if check_out < check_in
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You're checking this twice, here and with the total_stay method. A little odd. Also this if statement doesn't check to see if the dates are equal, but your total_stay method did.

Comment thread lib/date_range.rb
return total_nights
end

def date_check(date)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This method is a little vaguely named. I suggest naming it within_range to tell if a date is within the DateRange.

Comment thread lib/date_range.rb Outdated
return valid_date
end

def daterange_check(check_in, check_out)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This method is also a little misleading, I would call it overlap and pass another DateRange instance to compare. If this is the method you're using and you don't expect users to use date_check directly, I would also make that method private.

def initialize
@reservations = []
@block_reservations = []
end
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I suggest also keeping rooms as an array of numbers and setting it with your hotel_rooms method, so you don't have to repeatably call that method.

Comment thread spec/date_range_spec.rb

describe 'date check method' do
it 'returns true if checked date is within daterange (false if not)' do
expect(@test_daterange.date_check(Date.new(2019,3,12))).must_equal(true)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You should also check the start_date and end_date and check to see date_check on those dates.

Comment thread spec/date_range_spec.rb Outdated

describe 'daterange check method' do
it 'returns true if checked date is within daterange (false if not)' do
expect(@test_daterange.daterange_check(Date.new(2019,3,12),Date.new(2019,3,14))).must_equal(true)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Similar to the above, check the edge cases, date ranges that end on the start date of your date_range and another that starts on the end_date.

Then try some overlaps.

[*1..20].each do |room|
@frontdesk.book_reservation(room, Hotel::DateRange.new(Date.new(2019,3,15),Date.new(2019,3,18)))
end
expect(@frontdesk.room_availability(Date.new(2019,3,15), Date.new(2019,3,18))).must_equal([])
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

expect(@frontdesk.res_by_date(Date.new(2002,3,15)) ).must_be_instance_of(Array)
end

it "returns array of all booked reservations" do
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You should also test that it has the given reservations.

@smarchante1
Copy link
Copy Markdown
Author

smarchante1 commented Mar 24, 2019 via email

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