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

Kata/collections/test #47

Open
wants to merge 17 commits into
base: kata/collections/start
Choose a base branch
from
Open

Kata/collections/test #47

wants to merge 17 commits into from

Conversation

saket88
Copy link

@saket88 saket88 commented Sep 20, 2016

Adding pull request for the 2 hour coding exercise.

Copy link
Contributor

@wakaleo wakaleo left a 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);
Copy link
Contributor

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);
Copy link
Contributor

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);
Copy link
Contributor

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);

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