fix tests

This commit is contained in:
Martin Eyben 2024-11-27 21:05:48 +00:00
parent bc584b3ff0
commit 57081c4f43

View File

@ -1,5 +1,6 @@
package eirb.pg203; package eirb.pg203;
import eirb.pg203.exceptions.WeatherFetchingException;
import eirb.pg203.fakeJSONFetcher.FakeJSONFetcherOpenMeteo; import eirb.pg203.fakeJSONFetcher.FakeJSONFetcherOpenMeteo;
import eirb.pg203.fakeJSONFetcher.FakeJSONFetcherOpenWeatherMap; import eirb.pg203.fakeJSONFetcher.FakeJSONFetcherOpenWeatherMap;
import eirb.pg203.fakeJSONFetcher.FakeJSONFetcherWeatherAPI; import eirb.pg203.fakeJSONFetcher.FakeJSONFetcherWeatherAPI;
@ -77,7 +78,7 @@ public class WeatherDataAPITest {
@ParameterizedTest(name="[{0}] Temperature fetch at Bordeaux D+{1}") @ParameterizedTest(name="[{0}] Temperature fetch at Bordeaux D+{1}")
@MethodSource @MethodSource
public void testGetTemperature(WeatherDataAPI weatherDataAPI, int day, float expectedTemp, WeatherData.Condition expectedCond, float expectedWindSpeed, float expectedWindAngle) throws IOException { public void testGetTemperature(WeatherDataAPI weatherDataAPI, int day, float expectedTemp, WeatherData.Condition expectedCond, float expectedWindSpeed, float expectedWindAngle) throws WeatherFetchingException {
String city = "Bordeaux"; String city = "Bordeaux";
WeatherData weatherData; WeatherData weatherData;
weatherData = weatherDataAPI.getTemperature(day, city); weatherData = weatherDataAPI.getTemperature(day, city);
@ -116,7 +117,7 @@ public class WeatherDataAPITest {
} }
@ParameterizedTest(name = "[{0}] Fetch temperatures for {1} days") @ParameterizedTest(name = "[{0}] Fetch temperatures for {1} days")
@MethodSource @MethodSource
public void testGetTemperatures(WeatherDataAPI weatherDataAPI, int days, float[] expectedTemperatures, WeatherData.Condition[] expectedConditions, float[] expectedWindSpeed, float[] expectedWindDirection) throws IOException { public void testGetTemperatures(WeatherDataAPI weatherDataAPI, int days, float[] expectedTemperatures, WeatherData.Condition[] expectedConditions, float[] expectedWindSpeed, float[] expectedWindDirection) throws WeatherFetchingException{
String city = "Bordeaux"; String city = "Bordeaux";
ArrayList<WeatherData> weatherDatas; ArrayList<WeatherData> weatherDatas;