Skip to content

Comments

Laura_hotel project#40

Open
lauracodecreations wants to merge 49 commits intoAda-C10:masterfrom
lauracodecreations:master
Open

Laura_hotel project#40
lauracodecreations wants to merge 49 commits intoAda-C10:masterfrom
lauracodecreations:master

Conversation

@lauracodecreations
Copy link

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? when creating the blocks for the room, I was considering making a child class from rooms or making an instance variable in the room class. I decided to create an instance variable because I thought that creating a child class would make my code more complicated when accessing information about the block rooms.
Describe a concept that you gained more clarity on as you worked on this assignment. I learned more about how classes communicated with each other, how you can only change a value of instance variable in another class by a creating a method in that class that changes it. I also learned the purposes of creating method vs instance variables. For example, the cost in my reservation class should be an instance variable and not a method, because the date for the reservation never changes so I don't have to create a method that calculates it every time it is accessed.
Describe a nominal test that you wrote for this assignment. Checking if my reservation class correctly calculates the cost of a reservation
Describe an edge case test that you wrote for this assignment. to check that my admin class raises a Standard error for an invalid room number for a block
How do you feel you did in writing pseudocode first, then writing the tests and then the code? Thinking about the concept first before writing code definitely helps to write code with fewer bugs. Writing test before code helps to think about what the method should output for a given input which helps when writing the method

@CheezItMan
Copy link

Hotel

What We're Looking For

Feature Feedback
Baseline
Used git regularly Very good number of commits and commit messages
Answer comprehension questions Check, but I think you learned the wrong thing about costs for Reservation because if you later went back and changed how it worked, where the dates could be adjusted, then the cost would be incorrectly calculated.
Design
Each class is responsible for a single piece of the program Yes, although the Room class seems to be tracking both reservations and blocks. Plus Admin seems to be doing the job of determining if two reservations or blocks clash.
Classes are loosely coupled Reservation seems to be used in multiple classes.
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
Invalid date range produces an error Check
Wave 2
View available rooms for a given date range Check
Reserving a room that is not available produces an error Check
Test coverage 95.6%
Wave 3
Create a block of rooms Check
Check if a block has rooms Check
Reserve a room from a block Check
Fundamentals
Names variables, classes and modules appropriately For the most part
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, good use of private helper methods
Understands the differences between class and instance methods Check
Appropriately uses iterators and enumerables You used mostly .each where you could use Ennumerables.
Appropriately writes and utilizes classes Check
Appropriately utilizes modules as a mechanism to encapsulate functionality Check
Wrap Up
There is a refactors.txt file Check
The file provides a roadmap to future changes Check
Additional Feedback Nicely done. Your solution of having the room class track all it's reservations and blocks is a little awkward and required a lot of loops in your Admin class, but it does work. You hit all the learning goals. I did leave some comments in code and tests, but you did pretty well. Nice job. Review my comments and let me know if you have questions.

range = create_hotel_range(start_date, end_date) # for hotel
e_date = end_date - 1 # rooms do not keep track of last night
vacant_rooms = view_vacant_rooms(start_date, e_date)
if vacant_rooms.nil?

Choose a reason for hiding this comment

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

Shouldn't this method instead return an empty array if there are no rooms available?

return dates
end

private

Choose a reason for hiding this comment

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

Good that you're using private methods.

expect(@admin.rooms.first.ranges). must_equal range
end

it "no rooms available for 20 reservations" do

Choose a reason for hiding this comment

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

👍

info[:range] = range
@admin.reserve_room_in_block(info)
rooms = @admin.view_vacant_rooms_in_block(range)
expect(rooms.length).must_equal 3

Choose a reason for hiding this comment

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

You should also check for specific rooms available in the block

expect(rooms.length).must_equal 3
end

it "an outsider of a party can't reserve a room in a block" do

Choose a reason for hiding this comment

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

You should also test what happens if you reserve more rooms than are in the block.

@@ -0,0 +1,15 @@
require_relative 'spec_helper'

describe "#Room - initialize method" do

Choose a reason for hiding this comment

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

You also need methods testing the tracking of Reservations and Blocks.

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