ANCClient implements ANCSmartRegisterClient { @Override public String pastDueInDays() { return isBlank(edd) ? "0" : Integer.toString(daysBetween(parse(edd).toLocalDate(), today()).getDays()); } ANCClient(String entityId, String village, String name, String thayi, String edd, String lmp); @Override String entityId(); @Override String name(); @Override String displayName(); @Override String village(); String wifeName(); @Override String husbandName(); @Override int age(); @Override int ageInDays(); @Override String ageInString(); @Override boolean isSC(); @Override boolean isST(); @Override boolean isHighRisk(); @Override boolean isHighPriority(); @Override boolean isBPL(); @Override String profilePhotoPath(); @Override String locationStatus(); @Override boolean satisfiesFilter(String filterCriterion); @Override int compareName(SmartRegisterClient client); @Override String eddForDisplay(); @Override LocalDateTime edd(); @Override String pastDueInDays(); @Override String weeksAfterLMP(); @Override AlertDTO getAlert(ANCServiceType type); @Override boolean isVisitsDone(); @Override boolean isTTDone(); @Override boolean isIFADone(); @Override String ifaDoneDate(); @Override String ttDoneDate(); @Override String visitDoneDateWithVisitName(); @Override String thayiCardNumber(); @Override String ancNumber(); @Override String lmp(); @Override String riskFactors(); @Override List<ServiceProvidedDTO> allServicesProvidedForAServiceType(String serviceType); @Override String ashaPhoneNumber(); Map<String, Visits> serviceToVisitsMap(); ANCClient withHusbandName(String husbandName); ANCClient withAge(String age); ANCClient withECNumber(String ecNumber); ANCClient withANCNumber(String ancNumber); ANCClient withIsHighPriority(boolean highPriority); ANCClient withIsHighRisk(boolean highRisk); ANCClient withIsOutOfArea(boolean outOfArea); ANCClient withCaste(String caste); ANCClient withHighRiskReason(String highRiskReason); ANCClient withEconomicStatus(String economicStatus); ANCClient withPhotoPath(String photoPath); ANCClient withAlerts(List<AlertDTO> alerts); ANCClient withServicesProvided(List<ServiceProvidedDTO> servicesProvided); ANCClient withEntityIdToSavePhoto(String entityIdToSavePhoto); ANCClient withAshaPhoneNumber(String ashaPhoneNumber); ANCClient withPreProcess(); ANCClient withServiceToVisitMap(Map<String, Visits> serviceToVisitMap); ServiceProvidedDTO serviceProvidedToACategory(String category); @Override String getHyperTension(ServiceProvidedDTO ancServiceProvided); @Override ServiceProvidedDTO getServiceProvidedDTO(String serviceName); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static final String CATEGORY_ANC; static final String CATEGORY_TT; static final String CATEGORY_IFA; static final String CATEGORY_HB; static final String CATEGORY_DELIVERY_PLAN; static final String CATEGORY_PNC; }
@Test public void shouldReturnTheDaysBetweenEDDAndToday() throws Exception { DateUtil.fakeIt(new LocalDate("2014-02-28")); String daysBetween = getClient().pastDueInDays(); assertEquals("3", daysBetween); }