-
Notifications
You must be signed in to change notification settings - Fork 193
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
Kata/collections/test #47
base: kata/collections/start
Are you sure you want to change the base?
Kata/collections/test #47
Conversation
…ith LinkedHashSet
…th Treeset that accepts a comparator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work. There are a few unused fields and methods - use "run with coverage" to find any unused code and either delete it (if it is not required) or make sure it is covered by a unit test somewhere.
*/ | ||
public interface BookingStratgey { | ||
|
||
public BookingConfirmation checkIn( Pet pet); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "public" keyword on methods is not required for an interface.
|
||
public BookingConfirmation checkIn(Pet pet) { | ||
BookingStratgey bookingStrategy = BOOKING_STARTEGY.get(currentAvailability()); | ||
return bookingStrategy.checkIn(pet); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great use of the strategy pattern, well done!
|
||
//WHEN | ||
Pet fido = Pet.dog().named("Fido"); | ||
BookingResponse response =aPetHotel.checkIn(fido); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the response is not the focus of this particular test, you could also simply write:
aPetHotel.checkIn(fido);
Adding pull request for the 2 hour coding exercise.