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:
Alexey Zinchenko
2021-03-26 23:32:57 +03:00
committed by GitHub
parent 4c1b079e05
commit f5d202aee3
11 changed files with 78 additions and 44 deletions
@@ -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));
@@ -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));