-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
kiran1552
committed
Sep 20, 2016
1 parent
2a4dec4
commit ebf5486
Showing
4 changed files
with
126 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/main/java/serenitylabs/tutorials/vetclinic/collections/katas/BookingResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package serenitylabs.tutorials.vetclinic.collections.katas; | ||
|
||
/** | ||
* Created by kimahale on 9/20/2016. | ||
*/ | ||
public class BookingResponse { | ||
|
||
private final boolean confirmedStatus; | ||
|
||
public BookingResponse(boolean confirmedStatus) { | ||
this.confirmedStatus = confirmedStatus; | ||
} | ||
|
||
public boolean isConfirmed() { | ||
return confirmedStatus; | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
src/main/java/serenitylabs/tutorials/vetclinic/collections/katas/PetHotel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package serenitylabs.tutorials.vetclinic.collections.katas; | ||
|
||
import serenitylabs.tutorials.vetclinic.Pet; | ||
|
||
import java.util.*; | ||
|
||
/** | ||
* Created by kimahale on 9/20/2016. | ||
*/ | ||
public class PetHotel { | ||
|
||
private Collection<Pet> pets= new TreeSet<>(Comparator.comparing(Pet::getName)); | ||
public static int DEFAULT_MAXIMUM_CAPACITY = 20; | ||
|
||
public List<Pet> getPets() { | ||
return new ArrayList(pets); | ||
} | ||
|
||
public BookingResponse checkIn(Pet pet) { | ||
|
||
if (pets.size() <DEFAULT_MAXIMUM_CAPACITY) | ||
pets.add(pet); | ||
return new BookingResponse(true); | ||
} | ||
} |
75 changes: 75 additions & 0 deletions
75
...java/serenitylabs/tutorials/vetclinic/collections/katas/WhenBookingPetsIntoAPetHotel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters