@Test public void testForecastGetPrecipitations() throws Exception { OpenWeatherMapWeather weather = WeatherUtils.createOpenWeather(context); List<SimpleWeatherCondition> conditions = weather.getOpenWeatherMapConditions(); assertEquals(8, conditions.size()); assertEquals(0f, conditions.get(0).getPrecipitation().getValue(PrecipitationPeriod.PERIOD_1H), 0.01f); assertEquals(0.67f, conditions.get(1).getPrecipitation().getValue(PrecipitationPeriod.PERIOD_3H), 0.01f); assertEquals(0f, conditions.get(2).getPrecipitation().getValue(PrecipitationPeriod.PERIOD_3H), 0.01f); assertEquals(0f, conditions.get(3).getPrecipitation().getValue(PrecipitationPeriod.PERIOD_3H), 0.01f); assertEquals(1.24f, conditions.get(4).getPrecipitation().getValue(PrecipitationPeriod.PERIOD_3H), 0.01f); assertEquals(0.21f, conditions.get(5).getPrecipitation().getValue(PrecipitationPeriod.PERIOD_3H), 0.01f); assertEquals(0f, conditions.get(6).getPrecipitation().getValue(PrecipitationPeriod.PERIOD_3H), 0.01f); assertEquals(0f, conditions.get(7).getPrecipitation().getValue(PrecipitationPeriod.PERIOD_3H), 0.01f); }
List<SimpleWeatherCondition> getOpenWeatherMapConditions() { return this.conditions; }
OpenWeatherMapWeather implements Weather { List<SimpleWeatherCondition> getOpenWeatherMapConditions() { return this.conditions; } }
OpenWeatherMapWeather implements Weather { List<SimpleWeatherCondition> getOpenWeatherMapConditions() { return this.conditions; } OpenWeatherMapWeather(Context context);  OpenWeatherMapWeather(Context context, JSONObject jsonObject); }
OpenWeatherMapWeather implements Weather { List<SimpleWeatherCondition> getOpenWeatherMapConditions() { return this.conditions; } OpenWeatherMapWeather(Context context);  OpenWeatherMapWeather(Context context, JSONObject jsonObject); @Override Location getLocation(); @Override Date getTime(); @Override Date getQueryTime(); @Override UnitSystem getUnitSystem(); @Override List<WeatherCondition> getConditions(); @Override boolean isEmpty(); int getCityId(); URL getForecastURL(); }
OpenWeatherMapWeather implements Weather { List<SimpleWeatherCondition> getOpenWeatherMapConditions() { return this.conditions; } OpenWeatherMapWeather(Context context);  OpenWeatherMapWeather(Context context, JSONObject jsonObject); @Override Location getLocation(); @Override Date getTime(); @Override Date getQueryTime(); @Override UnitSystem getUnitSystem(); @Override List<WeatherCondition> getConditions(); @Override boolean isEmpty(); int getCityId(); URL getForecastURL();  }