mirror of
https://github.com/Prominence/openweathermap-java-api.git
synced 2026-07-04 03:36:44 +03:00
Version 2.0.1 (#13)
* Added method for weather icon id retrieval. Small internal changes in models. * Changed temperature unit signs.
This commit is contained in:
+9
-5
@@ -73,11 +73,15 @@ public class WeatherForecastUnitTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void whenSetIconUrl_thenValueIsSet() {
|
||||
public void whenSetIconId_thenValueIsSet() {
|
||||
final WeatherForecast weatherForecast = WeatherForecast.forValue("state", "desc");
|
||||
weatherForecast.setWeatherIconUrl("test");
|
||||
Assert.assertNull(weatherForecast.getWeatherIconId());
|
||||
Assert.assertNull(weatherForecast.getWeatherIconUrl());
|
||||
|
||||
Assert.assertEquals("test", weatherForecast.getWeatherIconUrl());
|
||||
weatherForecast.setWeatherIconId("02n");
|
||||
|
||||
Assert.assertEquals("02n", weatherForecast.getWeatherIconId());
|
||||
Assert.assertNotNull(weatherForecast.getWeatherIconUrl());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -258,11 +262,11 @@ public class WeatherForecastUnitTest {
|
||||
|
||||
Assert.assertTrue(one.equals(two));
|
||||
|
||||
one.setWeatherIconUrl("1");
|
||||
one.setWeatherIconId("1");
|
||||
|
||||
Assert.assertFalse(one.equals(two));
|
||||
|
||||
two.setWeatherIconUrl("1");
|
||||
two.setWeatherIconId("1");
|
||||
|
||||
Assert.assertTrue(one.equals(two));
|
||||
|
||||
|
||||
+9
-5
@@ -76,11 +76,15 @@ public class WeatherUnitTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void whenSetIconUrl_thenValueIsSet() {
|
||||
public void whenSetIconId_thenValueIsSet() {
|
||||
final Weather weather = Weather.forValue("state", "desc");
|
||||
weather.setWeatherIconUrl("test");
|
||||
Assert.assertNull(weather.getWeatherIconId());
|
||||
Assert.assertNull(weather.getWeatherIconUrl());
|
||||
|
||||
Assert.assertEquals("test", weather.getWeatherIconUrl());
|
||||
weather.setWeatherIconId("11d");
|
||||
|
||||
Assert.assertEquals("11d", weather.getWeatherIconId());
|
||||
Assert.assertNotNull(weather.getWeatherIconUrl());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -235,11 +239,11 @@ public class WeatherUnitTest {
|
||||
|
||||
Assert.assertTrue(one.equals(two));
|
||||
|
||||
one.setWeatherIconUrl("1");
|
||||
one.setWeatherIconId("1");
|
||||
|
||||
Assert.assertFalse(one.equals(two));
|
||||
|
||||
two.setWeatherIconUrl("1");
|
||||
two.setWeatherIconId("1");
|
||||
|
||||
Assert.assertTrue(one.equals(two));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user