WootricCustomMessage implements Parcelable { public String getPlaceholderForScore(int scoreValue, String surveyType, int surveyTypeScale) { final Score score = new Score(scoreValue, surveyType, surveyTypeScale); if(score.isDetractor() && getDetractorPlaceholder() != null) { return getDetractorPlaceholder(); } else if(score.isPassive() && getPassivePlaceholder() != null) { return getPassivePlaceholder(); } else if(score.isPromoter() && getPromoterPlaceholder() != null) { return getPromoterPlaceholder(); } else { return placeholderText; } } WootricCustomMessage();  WootricCustomMessage(WootricCustomMessage wootricCustomMessage); private  WootricCustomMessage(Parcel in); String getFollowupQuestion(); String getPlaceholderText(); void setFollowupQuestion(String followupQuestion); void setDetractorFollowupQuestion(String detractorFollowupQuestion); void setPassiveFollowupQuestion(String passiveFollowupQuestion); void setPromoterFollowupQuestion(String promoterFollowupQuestion); void setPlaceholderText(String placeholderText); void setDetractorPlaceholderText(String detractorPlaceholderText); void setPassivePlaceholderText(String passivePlaceholderText); void setPromoterPlaceholderText(String promoterPlaceholderText); String getFollowupQuestionForScore(int scoreValue, String surveyType, int surveyTypeScale); String getPlaceholderForScore(int scoreValue, String surveyType, int surveyTypeScale); void setFollowupQuestionsList(HashMap<String, String> followupQuestionsList); void setPlaceholderTextsList(HashMap<String, String> placeholderTextsList); @Override int describeContents(); @Override void writeToParcel(Parcel dest, int flags); static WootricCustomMessage fromJson(JSONObject customMessagesJson); static final Creator<WootricCustomMessage> CREATOR; }
@Test public void returnsDetractorPlaceholder_forNPSDetractorScore() throws Exception { assertThat(customMessage.getPlaceholderForScore(0, "NPS", 0)).isEqualTo("detractor_prompt_text"); assertThat(customMessage.getPlaceholderForScore(6, "NPS", 0)).isEqualTo("detractor_prompt_text"); }
@Test public void returnsPassivePlaceholder_forNPSPassiveScore() throws Exception { assertThat(customMessage.getPlaceholderForScore(7, "NPS", 0)).isEqualTo("passive_prompt_text"); assertThat(customMessage.getPlaceholderForScore(8, "NPS", 0)).isEqualTo("passive_prompt_text"); }
@Test public void returnsPromoterPlaceholder_forNPSPromoterScore() throws Exception { assertThat(customMessage.getPlaceholderForScore(9, "NPS", 0)).isEqualTo("promoter_prompt_text"); assertThat(customMessage.getPlaceholderForScore(10, "NPS", 0)).isEqualTo("promoter_prompt_text"); }
@Test public void returnsDetractorPlaceholder_forCESDetractorScore() throws Exception { assertThat(customMessage.getPlaceholderForScore(1, "CES", 0)).isEqualTo("detractor_prompt_text"); assertThat(customMessage.getPlaceholderForScore(3, "CES", 0)).isEqualTo("detractor_prompt_text"); }
@Test public void returnsPassivePlaceholder_forCESPassiveScore() throws Exception { assertThat(customMessage.getPlaceholderForScore(4, "CES", 0)).isEqualTo("passive_prompt_text"); assertThat(customMessage.getPlaceholderForScore(5, "CES", 0)).isEqualTo("passive_prompt_text"); }
@Test public void returnsPromoterPlaceholder_forCESPromoterScore() throws Exception { assertThat(customMessage.getPlaceholderForScore(6, "CES", 0)).isEqualTo("promoter_prompt_text"); assertThat(customMessage.getPlaceholderForScore(7, "CES", 0)).isEqualTo("promoter_prompt_text"); }
@Test public void returnsDetractorPlaceholder_forCSATDetractorScore() throws Exception { assertThat(customMessage.getPlaceholderForScore(1, "CSAT", 0)).isEqualTo("detractor_prompt_text"); assertThat(customMessage.getPlaceholderForScore(2, "CSAT", 0)).isEqualTo("detractor_prompt_text"); }
@Test public void returnsPassivePlaceholder_forCSATPassiveScore() throws Exception { assertThat(customMessage.getPlaceholderForScore(3, "CSAT", 0)).isEqualTo("passive_prompt_text"); }
@Test public void returnsPromoterPlaceholder_forCSATPromoterScore() throws Exception { assertThat(customMessage.getPlaceholderForScore(5, "CSAT", 0)).isEqualTo("promoter_prompt_text"); }