Skip to content

Conversation

@OhCloud
Copy link

@OhCloud OhCloud commented Sep 9, 2019

Hotel

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
What was a design challenge that you encountered on this project? The way that each class handled its responsibilities is something i put alot of emphasis to because the more clear cut the design, the better the code is, you know agile vs bufd but sometimes i think thats the better way to go for projects this size.
What was a design decision you made that changed over time over the project? I went back and forth between few classes and lots of classes... alot. having decided what my uml looked like, what was gonna do what, i started. only to delete a class, and then add another class, and another.
What was a concept you gained clarity on, or a learning that you'd like to share? the way the tests are was something that i think is sinking in. for testing - the way that the instance variables hold information and the way they are extracted is clear now and thats rad.
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 would be like reservation_test / instance of reservation. this is a nominal case bc we know this does create an instance of reservation.
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 would be checking that checking out date cant happen before a check in date. we know this to be true bc time.
How do you feel you did in writing pseudocode first, then writing the tests and then the code? i will make it a point to sudo-code more. I still cant break the habit of first writing the test and then writing the code. I will put more emphasis into this by doing lots of pseudocode.

ohcloud added 14 commits September 3, 2019 14:16
…ze for date_range.rb and tests for date_range_tests.
…s. added a parameter to the hotel manager initalize to aid in this. added test for it. we good.
…ure that block.rb works properly. added create block and reserve from block methods. test are all passing. added caveat to block initialize to adhere to the 5 block room max. test pass for that too.
@dHelmgren
Copy link

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 Code coverage doesn't seem to be set up correctly, and indicates 30% coverage.
Wave 2
View available rooms for a given date range yes
Reserving a room that is not available produces an error yes
Test coverage NA
Wave 3
Create a block of rooms yes
Check if a block has rooms yes
Reserve a room from a block yes, but it's not explicitly tested!
Test coverage yes

Code Review

Baseline Feedback
Used git regularly Yes, great commit comments!
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!

I am particularly impressed by the way that you broke down the problem with methods while keeping the code loosely coupled. There is nothing but trim, direct code here. This code kicks tons of butt, and you should be super proud!

I do see some room for improvement around editing your code to remove warnings. Also, don't forget to check your code coverage, it was including your tests, and therefore wasn't checking things properly. Your tests were thorough, but you need to prove it!

end

it "will raise an Argument Error if block requested is more than 5" do
expect{block = Hotel::Block.new(@checkin_date, @checkout_date, 100, [4, 5, 6, 7, 8, 9])}.must_raise ArgumentError

Choose a reason for hiding this comment

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

block isn't used, threw an warning

require 'pry'
require 'awesome_print'

require_relative "../lib/reservation.rb"

Choose a reason for hiding this comment

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

circular require, warning

require 'pry'
require 'awesome_print'

require_relative "../lib/date_range.rb"

Choose a reason for hiding this comment

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

circular require, warning

require 'awesome_print'

require_relative "../lib/date_range.rb"
require_relative "../lib/hotel_manager.rb"

Choose a reason for hiding this comment

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

circular require, warning

class Hotel_Manager
attr_reader :all_rooms, :available_rooms, :reservations,:block_reservations

def initialize(hotel_size)

Choose a reason for hiding this comment

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

The gist of the instructions tried to lead you to the conclusion that the hotel's size wasn't malleable. 20 rooms, always.

end

avail_rooms -= rooms_blocked

Choose a reason for hiding this comment

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

This section could use some comments!

avail_rooms = @all_rooms

block_overlaps = @block_reservations.select do |block|
block.overlaps?(date_range)

Choose a reason for hiding this comment

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

Nice work delegating!


I really considered creating a csv to load from but, I dont think thats a possibility per the project. It couldve been fun(hard) to create and use it though I should definitely think that through a bit more because maybe the refactor wouldnt be worth the time? My tutor mentioned it early on and it did seem both easier and very straightforward and also intimidating bc I know I'm not super comfortable with reading (or writing) to csvs.

I should definitley go back and update the ArgumentErrors, I know I had to much fun with them. I see how giving myself a giggle would be a problem to someone else reviewing my code, especially if those errors were raised.

Choose a reason for hiding this comment

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

I was going to comment about this and then thought "nah, i did that all the time as a student." lol

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