Skip to content

Kata/collections/test#47

Open
saket88 wants to merge 17 commits intoserenity-dojo:kata/collections/startfrom
saket88:kata/collections/test
Open

Kata/collections/test#47
saket88 wants to merge 17 commits intoserenity-dojo:kata/collections/startfrom
saket88:kata/collections/test

Conversation

@saket88
Copy link
Copy Markdown

@saket88 saket88 commented Sep 20, 2016

Adding pull request for the 2 hour coding exercise.

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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