ECClient implements ECSmartRegisterClient { public boolean satisfiesFilter(String filter) { return name.toLowerCase(Locale.getDefault()).startsWith(filter.toLowerCase()) || String.valueOf(ecNumber).startsWith(filter); } ECClient(String entityId, String name, String husbandName, String village, Integer ecNumber); String wifeName(); @Override String village(); @Override String name(); @Override String husbandName(); @Override String ageInString(); @Override int age(); @Override int ageInDays(); @Override String displayName(); @Override int compareName(SmartRegisterClient client); Integer ecNumber(); String locationStatus(); @Override boolean isSC(); @Override boolean isST(); @Override boolean isHighRisk(); @Override boolean isHighPriority(); @Override boolean isBPL(); @Override String profilePhotoPath(); FPMethod fpMethod(); List<ECChildClient> children(); Map<String, String> status(); String entityId(); String numberOfPregnancies(); String parity(); String numberOfLivingChildren(); String numberOfStillbirths(); String numberOfAbortions(); String familyPlanningMethodChangeDate(); String numberOfOCPDelivered(); String numberOfCondomsSupplied(); String numberOfCentchromanPillsDelivered(); String iudPerson(); String iudPlace(); ECClient withDateOfBirth(String dateOfBirth); ECClient withIsOutOfArea(boolean outOfArea); ECClient withFPMethod(String fp_method); ECClient withNumberOfPregnancies(String num_pregnancies); ECClient withParity(String parity); ECClient withNumberOfLivingChildren(String num_living_children); ECClient withNumberOfStillBirths(String num_stillbirths); ECClient withNumberOfAbortions(String num_abortions); ECClient withIsHighPriority(boolean highPriority); ECClient withFamilyPlanningMethodChangeDate(String family_planning_method_change_date); ECClient withPhotoPath(String photo_path); ECClient withCaste(String caste); ECClient withEconomicStatus(String economicStatus); ECClient withIUDPlace(String iudPlace); ECClient withIUDPerson(String iudPerson); ECClient withNumberOfCondomsSupplied(String numberOfCondomsSupplied); ECClient withNumberOfCentchromanPillsDelivered(String numberOfCentchromanPillsDelivered); ECClient withNumberOfOCPDelivered(String numberOfOCPDelivered); ECClient withHighPriorityReason(String highPriorityReason); ECClient withChildren(List<ECChildClient> children); ECClient addChild(ECChildClient childClient); ECClient withStatus(Map<String, String> status); boolean satisfiesFilter(String filter); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test public void shouldSatisfyFilterForNameStartingWithSameCharacters() { boolean filterMatches = getClient().satisfiesFilter("Dr"); assertTrue(filterMatches); }
@Test public void shouldSatisfyFilterForECNumberStartingWithSameCharacters() { boolean filterMatches = getClient().satisfiesFilter("12"); assertTrue(filterMatches); }
@Test public void shouldNotSatisfyFilterForNameNotStartingWithSameCharacters() { boolean filterMatches = getClient().satisfiesFilter("shti"); assertFalse(filterMatches); }
@Test public void shouldSatisfyFilterForBlankName() { boolean filterMatches = getClient().satisfiesFilter(""); assertTrue(filterMatches); }
@Test public void shouldNotSatisfyFilterForECNumberNotStartingWithSameCharacters() { boolean filterMatches = getClient().satisfiesFilter("23"); assertFalse(filterMatches); }
@Test public void shouldSatisfyFilterForBlankECNumber() { boolean filterMatches = getClient().satisfiesFilter(""); assertTrue(filterMatches); }