@Test public void GIVEN_populated_client_raw_fields_WHEN_heat_index_color_requested_THEN_color_returned() { int color = testee.colorize(WeatherItem.HEAT_INDEX); assertEquals(TemperatureColorizer.LIGHT_ORANGE, color); }
public int colorize(WeatherItem weatherItem) { int colorCode; switch (weatherItem) { case APPARENT_TEMPERATURE: colorCode = new TemperatureColorizer(clientRaw.getApparentTemperature()).colorize(); break; case DEW_POINT: colorCode = new TemperatureColorizer(clientRaw.getDewPoint()).colorize(); break; case HEAT_INDEX: colorCode = new TemperatureColorizer(clientRaw.getHeatIndex()).colorize(); break; case HUMIDEX: colorCode = new TemperatureColorizer(clientRaw.getHumidex()).colorize(); break; case UV_INDEX: colorCode = new UvIndexColorizer(clientRaw.getUvIndex()).colorize(); break; case WIND_CHILL: colorCode = new TemperatureColorizer(clientRaw.getWindChill()).colorize(); break; default: colorCode = WHITE; } return colorCode; }
WeatherItemColorizer { public int colorize(WeatherItem weatherItem) { int colorCode; switch (weatherItem) { case APPARENT_TEMPERATURE: colorCode = new TemperatureColorizer(clientRaw.getApparentTemperature()).colorize(); break; case DEW_POINT: colorCode = new TemperatureColorizer(clientRaw.getDewPoint()).colorize(); break; case HEAT_INDEX: colorCode = new TemperatureColorizer(clientRaw.getHeatIndex()).colorize(); break; case HUMIDEX: colorCode = new TemperatureColorizer(clientRaw.getHumidex()).colorize(); break; case UV_INDEX: colorCode = new UvIndexColorizer(clientRaw.getUvIndex()).colorize(); break; case WIND_CHILL: colorCode = new TemperatureColorizer(clientRaw.getWindChill()).colorize(); break; default: colorCode = WHITE; } return colorCode; } }
WeatherItemColorizer { public int colorize(WeatherItem weatherItem) { int colorCode; switch (weatherItem) { case APPARENT_TEMPERATURE: colorCode = new TemperatureColorizer(clientRaw.getApparentTemperature()).colorize(); break; case DEW_POINT: colorCode = new TemperatureColorizer(clientRaw.getDewPoint()).colorize(); break; case HEAT_INDEX: colorCode = new TemperatureColorizer(clientRaw.getHeatIndex()).colorize(); break; case HUMIDEX: colorCode = new TemperatureColorizer(clientRaw.getHumidex()).colorize(); break; case UV_INDEX: colorCode = new UvIndexColorizer(clientRaw.getUvIndex()).colorize(); break; case WIND_CHILL: colorCode = new TemperatureColorizer(clientRaw.getWindChill()).colorize(); break; default: colorCode = WHITE; } return colorCode; } WeatherItemColorizer(ClientRaw clientRaw); }
WeatherItemColorizer { public int colorize(WeatherItem weatherItem) { int colorCode; switch (weatherItem) { case APPARENT_TEMPERATURE: colorCode = new TemperatureColorizer(clientRaw.getApparentTemperature()).colorize(); break; case DEW_POINT: colorCode = new TemperatureColorizer(clientRaw.getDewPoint()).colorize(); break; case HEAT_INDEX: colorCode = new TemperatureColorizer(clientRaw.getHeatIndex()).colorize(); break; case HUMIDEX: colorCode = new TemperatureColorizer(clientRaw.getHumidex()).colorize(); break; case UV_INDEX: colorCode = new UvIndexColorizer(clientRaw.getUvIndex()).colorize(); break; case WIND_CHILL: colorCode = new TemperatureColorizer(clientRaw.getWindChill()).colorize(); break; default: colorCode = WHITE; } return colorCode; } WeatherItemColorizer(ClientRaw clientRaw); int colorize(WeatherItem weatherItem); }
WeatherItemColorizer { public int colorize(WeatherItem weatherItem) { int colorCode; switch (weatherItem) { case APPARENT_TEMPERATURE: colorCode = new TemperatureColorizer(clientRaw.getApparentTemperature()).colorize(); break; case DEW_POINT: colorCode = new TemperatureColorizer(clientRaw.getDewPoint()).colorize(); break; case HEAT_INDEX: colorCode = new TemperatureColorizer(clientRaw.getHeatIndex()).colorize(); break; case HUMIDEX: colorCode = new TemperatureColorizer(clientRaw.getHumidex()).colorize(); break; case UV_INDEX: colorCode = new UvIndexColorizer(clientRaw.getUvIndex()).colorize(); break; case WIND_CHILL: colorCode = new TemperatureColorizer(clientRaw.getWindChill()).colorize(); break; default: colorCode = WHITE; } return colorCode; } WeatherItemColorizer(ClientRaw clientRaw); int colorize(WeatherItem weatherItem);  }