@Test public void expectGreenWhenReadingValueIs100WithADAPreferredRange() { assertTrue(glucoseRanges.colorFromReading(100).equals("green")); }
public String colorFromReading(double reading) { if (reading < HYPO_LIMIT) { return "purple"; } else if (reading > HYPER_LIMIT) { return "red"; } else if (reading < userMin) { return "blue"; } else if (reading > userMax) { return "orange"; } else { return "green"; } }
GlucoseRanges { public String colorFromReading(double reading) { if (reading < HYPO_LIMIT) { return "purple"; } else if (reading > HYPER_LIMIT) { return "red"; } else if (reading < userMin) { return "blue"; } else if (reading > userMax) { return "orange"; } else { return "green"; } } }
GlucoseRanges { public String colorFromReading(double reading) { if (reading < HYPO_LIMIT) { return "purple"; } else if (reading > HYPER_LIMIT) { return "red"; } else if (reading < userMin) { return "blue"; } else if (reading > userMax) { return "orange"; } else { return "green"; } } GlucoseRanges(Context context); }
GlucoseRanges { public String colorFromReading(double reading) { if (reading < HYPO_LIMIT) { return "purple"; } else if (reading > HYPER_LIMIT) { return "red"; } else if (reading < userMin) { return "blue"; } else if (reading > userMax) { return "orange"; } else { return "green"; } } GlucoseRanges(Context context); static int getPresetMin(String preset); static int getPresetMax(String preset); String colorFromReading(double reading); int stringToColor(String color); }
GlucoseRanges { public String colorFromReading(double reading) { if (reading < HYPO_LIMIT) { return "purple"; } else if (reading > HYPER_LIMIT) { return "red"; } else if (reading < userMin) { return "blue"; } else if (reading > userMax) { return "orange"; } else { return "green"; } } GlucoseRanges(Context context); static int getPresetMin(String preset); static int getPresetMax(String preset); String colorFromReading(double reading); int stringToColor(String color);  }