From f9847304cc5f5a5d62b14554bd979bc90cc1a5dc Mon Sep 17 00:00:00 2001 From: Gramli Date: Wed, 28 Feb 2024 20:49:03 +0100 Subject: [PATCH] Refactor & change long, lat data type to double --- src/Tests/HttpDebug/debug-tests.http | 8 ++--- .../WeatherSystemTests.cs | 8 ++--- .../Services/WeatherServiceTests.cs | 36 +++++++++---------- .../EndpointBuilders/WeatherBuilder.cs | 4 +-- .../ContainerConfigurationExtension.cs | 12 ++----- .../Validation/GeneralPredicates.cs | 4 +-- src/Weather.Domain/Dtos/LocationDto.cs | 4 +-- .../Queries/GetCurrentWeatherQuery.cs | 2 +- .../Queries/GetForecastWeatherQuery.cs | 2 +- .../ContainerConfigurationExtension.cs | 20 +++-------- .../Entities/FavoriteLocationEntity.cs | 4 +-- .../Abstractions/IWeatherbitHttpClient.cs | 4 +-- src/Wheaterbit.Client/WeatherbitHttpClient.cs | 4 +-- 13 files changed, 48 insertions(+), 64 deletions(-) diff --git a/src/Tests/HttpDebug/debug-tests.http b/src/Tests/HttpDebug/debug-tests.http index 54f8bbe..ecc6bf3 100644 --- a/src/Tests/HttpDebug/debug-tests.http +++ b/src/Tests/HttpDebug/debug-tests.http @@ -3,11 +3,11 @@ @host={{hostname}}:{{port}} ### get current weather request -GET https://{{host}}/weather/v1/current?latitude=1&longtitude=1 +GET https://{{host}}/weather/v1/current?latitude=38.5&longtitude=-78.5 Content-Type: application/json ### get forecast weather request -GET https://{{host}}/weather/v1/forecast?latitude=1&longtitude=1 +GET https://{{host}}/weather/v1/forecast?latitude=38.5&longtitude=-78.5 Content-Type: application/json ### get favorites weather request @@ -20,7 +20,7 @@ Content-Type: application/json { "location": { - "latitude": 1, - "longitude": 1 + "latitude": 38.5, + "longitude": -78.5 } } \ No newline at end of file diff --git a/src/Tests/SystemTests/Weather.API.SystemTests/WeatherSystemTests.cs b/src/Tests/SystemTests/Weather.API.SystemTests/WeatherSystemTests.cs index db931cb..4d13c15 100644 --- a/src/Tests/SystemTests/Weather.API.SystemTests/WeatherSystemTests.cs +++ b/src/Tests/SystemTests/Weather.API.SystemTests/WeatherSystemTests.cs @@ -9,9 +9,9 @@ namespace Weather.API.SystemTests { public class WeatherSystemTests { - private readonly long latitude = 1; - private readonly long longtitude = 1; - private readonly string cityName = "Mumford"; + private readonly double latitude = 38.5; + private readonly double longtitude = -78.5; + private readonly string cityName = "Stanley"; private readonly HttpClient _httpClient; @@ -41,7 +41,7 @@ public async Task GetForecastWeather() { //Arrange //Act - var response = await _httpClient.GetAsync("weather/v1/forecast?latitude=1&longtitude=1"); + var response = await _httpClient.GetAsync($"weather/v1/forecast?latitude={latitude}&longtitude={longtitude}"); //Assert response.EnsureSuccessStatusCode(); diff --git a/src/Tests/UnitTests/Weather.Infrastructure.UnitTests/Services/WeatherServiceTests.cs b/src/Tests/UnitTests/Weather.Infrastructure.UnitTests/Services/WeatherServiceTests.cs index 428e9c4..ecfe81a 100644 --- a/src/Tests/UnitTests/Weather.Infrastructure.UnitTests/Services/WeatherServiceTests.cs +++ b/src/Tests/UnitTests/Weather.Infrastructure.UnitTests/Services/WeatherServiceTests.cs @@ -28,14 +28,14 @@ public async Task GetCurrentWeather_Failed() var location = new LocationDto { Latitude = 15, Longitude = 25 }; var failedMessage = "message"; - _weatherbiClientMock.Setup(x=>x.GetCurrentWeather(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Fail(failedMessage)); + _weatherbiClientMock.Setup(x=>x.GetCurrentWeather(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Fail(failedMessage)); //Act var result = await _uut.GetCurrentWeather(location, CancellationToken.None); //Assert Assert.True(result.IsFailed); Assert.Single(result.Errors); Assert.Equal(failedMessage, result.Errors.First().Message); - _weatherbiClientMock.Verify(x => x.GetCurrentWeather(It.Is(y=>y.Equals(location.Latitude)), It.Is(y => y.Equals(location.Longitude)), It.IsAny()), Times.Once); + _weatherbiClientMock.Verify(x => x.GetCurrentWeather(It.Is(y=>y.Equals(location.Latitude)), It.Is(y => y.Equals(location.Longitude)), It.IsAny()), Times.Once); } [Fact] @@ -44,14 +44,14 @@ public async Task GetCurrentWeather_NullData() //Arrange var location = new LocationDto { Latitude = 15, Longitude = 25 }; - _weatherbiClientMock.Setup(x => x.GetCurrentWeather(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Ok((CurrentWeatherDataDto)null)); + _weatherbiClientMock.Setup(x => x.GetCurrentWeather(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Ok((CurrentWeatherDataDto)null)); //Act var result = await _uut.GetCurrentWeather(location, CancellationToken.None); //Assert Assert.True(result.IsFailed); Assert.Single(result.Errors); Assert.Equal(ErrorMessages.ExternalClientGetDataFailed_EmptyOrNull, result.Errors.First().Message); - _weatherbiClientMock.Verify(x => x.GetCurrentWeather(It.Is(y => y.Equals(location.Latitude)), It.Is(y => y.Equals(location.Longitude)), It.IsAny()), Times.Once); + _weatherbiClientMock.Verify(x => x.GetCurrentWeather(It.Is(y => y.Equals(location.Latitude)), It.Is(y => y.Equals(location.Longitude)), It.IsAny()), Times.Once); } [Fact] @@ -60,14 +60,14 @@ public async Task GetCurrentWeather_EmptyData() //Arrange var location = new LocationDto { Latitude = 15, Longitude = 25 }; - _weatherbiClientMock.Setup(x => x.GetCurrentWeather(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Ok(new CurrentWeatherDataDto())); + _weatherbiClientMock.Setup(x => x.GetCurrentWeather(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Ok(new CurrentWeatherDataDto())); //Act var result = await _uut.GetCurrentWeather(location, CancellationToken.None); //Assert Assert.True(result.IsFailed); Assert.Single(result.Errors); Assert.Contains(ErrorMessages.ExternalClientGetDataFailed_EmptyOrNull, result.Errors.First().Message); - _weatherbiClientMock.Verify(x => x.GetCurrentWeather(It.Is(y => y.Equals(location.Latitude)), It.Is(y => y.Equals(location.Longitude)), It.IsAny()), Times.Once); + _weatherbiClientMock.Verify(x => x.GetCurrentWeather(It.Is(y => y.Equals(location.Latitude)), It.Is(y => y.Equals(location.Longitude)), It.IsAny()), Times.Once); } [Fact] @@ -81,7 +81,7 @@ public async Task GetCurrentWeather_ManyData() new Wheaterbit.Client.Dtos.CurrentWeatherDto() }; - _weatherbiClientMock.Setup(x => x.GetCurrentWeather(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Ok(new CurrentWeatherDataDto + _weatherbiClientMock.Setup(x => x.GetCurrentWeather(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Ok(new CurrentWeatherDataDto { Data = data })); @@ -91,7 +91,7 @@ public async Task GetCurrentWeather_ManyData() Assert.True(result.IsFailed); Assert.Single(result.Errors); Assert.Contains(string.Format(ErrorMessages.ExternalClientGetDataFailed_CorruptedData_InvalidCount, 2), result.Errors.First().Message); - _weatherbiClientMock.Verify(x => x.GetCurrentWeather(It.Is(y => y.Equals(location.Latitude)), It.Is(y => y.Equals(location.Longitude)), It.IsAny()), Times.Once); + _weatherbiClientMock.Verify(x => x.GetCurrentWeather(It.Is(y => y.Equals(location.Latitude)), It.Is(y => y.Equals(location.Longitude)), It.IsAny()), Times.Once); } [Fact] @@ -106,7 +106,7 @@ public async Task GetCurrentWeather_Success() var mapResult = new Domain.Dtos.CurrentWeatherDto(); - _weatherbiClientMock.Setup(x => x.GetCurrentWeather(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Ok(new CurrentWeatherDataDto + _weatherbiClientMock.Setup(x => x.GetCurrentWeather(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Ok(new CurrentWeatherDataDto { Data = data })); @@ -119,7 +119,7 @@ public async Task GetCurrentWeather_Success() //Assert Assert.True(result.IsSuccess); Assert.Empty(result.Errors); - _weatherbiClientMock.Verify(x => x.GetCurrentWeather(It.Is(y => y.Equals(location.Latitude)), It.Is(y => y.Equals(location.Longitude)), It.IsAny()), Times.Once); + _weatherbiClientMock.Verify(x => x.GetCurrentWeather(It.Is(y => y.Equals(location.Latitude)), It.Is(y => y.Equals(location.Longitude)), It.IsAny()), Times.Once); Assert.Equivalent(mapResult, result.Value); _mapperMock.Verify(x => x.Map(It.IsAny()), Times.Once); } @@ -131,14 +131,14 @@ public async Task GetForecastWeather_Failed() var location = new LocationDto { Latitude = 15, Longitude = 25 }; var failedMessage = "message"; - _weatherbiClientMock.Setup(x => x.GetSixteenDayForecast(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Fail(failedMessage)); + _weatherbiClientMock.Setup(x => x.GetSixteenDayForecast(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Fail(failedMessage)); //Act var result = await _uut.GetForecastWeather(location, CancellationToken.None); //Assert Assert.True(result.IsFailed); Assert.Single(result.Errors); Assert.Equal(failedMessage, result.Errors.First().Message); - _weatherbiClientMock.Verify(x => x.GetSixteenDayForecast(It.Is(y => y.Equals(location.Latitude)), It.Is(y => y.Equals(location.Longitude)), It.IsAny()), Times.Once); + _weatherbiClientMock.Verify(x => x.GetSixteenDayForecast(It.Is(y => y.Equals(location.Latitude)), It.Is(y => y.Equals(location.Longitude)), It.IsAny()), Times.Once); } [Fact] @@ -147,14 +147,14 @@ public async Task GetForecastWeather_NullData() //Arrange var location = new LocationDto { Latitude = 15, Longitude = 25 }; - _weatherbiClientMock.Setup(x => x.GetSixteenDayForecast(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Ok((Wheaterbit.Client.Dtos.ForecastWeatherDto)null)); + _weatherbiClientMock.Setup(x => x.GetSixteenDayForecast(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Ok((Wheaterbit.Client.Dtos.ForecastWeatherDto)null)); //Act var result = await _uut.GetForecastWeather(location, CancellationToken.None); //Assert Assert.True(result.IsFailed); Assert.Single(result.Errors); Assert.Equal(ErrorMessages.ExternalClientGetDataFailed_EmptyOrNull, result.Errors.First().Message); - _weatherbiClientMock.Verify(x => x.GetSixteenDayForecast(It.Is(y => y.Equals(location.Latitude)), It.Is(y => y.Equals(location.Longitude)), It.IsAny()), Times.Once); + _weatherbiClientMock.Verify(x => x.GetSixteenDayForecast(It.Is(y => y.Equals(location.Latitude)), It.Is(y => y.Equals(location.Longitude)), It.IsAny()), Times.Once); } [Fact] @@ -163,14 +163,14 @@ public async Task GetForecastWeather_EmptyData() //Arrange var location = new LocationDto { Latitude = 15, Longitude = 25 }; - _weatherbiClientMock.Setup(x => x.GetSixteenDayForecast(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Ok(new Wheaterbit.Client.Dtos.ForecastWeatherDto())); + _weatherbiClientMock.Setup(x => x.GetSixteenDayForecast(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Ok(new Wheaterbit.Client.Dtos.ForecastWeatherDto())); //Act var result = await _uut.GetForecastWeather(location, CancellationToken.None); //Assert Assert.True(result.IsFailed); Assert.Single(result.Errors); Assert.Contains(ErrorMessages.ExternalClientGetDataFailed_EmptyOrNull, result.Errors.First().Message); - _weatherbiClientMock.Verify(x => x.GetSixteenDayForecast(It.Is(y => y.Equals(location.Latitude)), It.Is(y => y.Equals(location.Longitude)), It.IsAny()), Times.Once); + _weatherbiClientMock.Verify(x => x.GetSixteenDayForecast(It.Is(y => y.Equals(location.Latitude)), It.Is(y => y.Equals(location.Longitude)), It.IsAny()), Times.Once); } [Fact] @@ -188,7 +188,7 @@ public async Task GetForecastWeather_Success() var mapResult = new Domain.Dtos.ForecastWeatherDto(); - _weatherbiClientMock.Setup(x => x.GetSixteenDayForecast(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Ok(data)); + _weatherbiClientMock.Setup(x => x.GetSixteenDayForecast(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(Result.Ok(data)); _mapperMock.Setup(x => x.Map(It.IsAny())).Returns(mapResult); @@ -198,7 +198,7 @@ public async Task GetForecastWeather_Success() //Assert Assert.True(result.IsSuccess); Assert.Empty(result.Errors); - _weatherbiClientMock.Verify(x => x.GetSixteenDayForecast(It.Is(y => y.Equals(location.Latitude)), It.Is(y => y.Equals(location.Longitude)), It.IsAny()), Times.Once); + _weatherbiClientMock.Verify(x => x.GetSixteenDayForecast(It.Is(y => y.Equals(location.Latitude)), It.Is(y => y.Equals(location.Longitude)), It.IsAny()), Times.Once); Assert.Equivalent(mapResult, result.Value); _mapperMock.Verify(x => x.Map(It.IsAny()), Times.Once); } diff --git a/src/Weather.API/EndpointBuilders/WeatherBuilder.cs b/src/Weather.API/EndpointBuilders/WeatherBuilder.cs index a7b1fdb..5e7c66d 100644 --- a/src/Weather.API/EndpointBuilders/WeatherBuilder.cs +++ b/src/Weather.API/EndpointBuilders/WeatherBuilder.cs @@ -25,7 +25,7 @@ public static IEndpointRouteBuilder BuildWeatherEndpoints(this IEndpointRouteBui private static IEndpointRouteBuilder BuildActualWeatherEndpoints(this IEndpointRouteBuilder endpointRouteBuilder) { endpointRouteBuilder.MapGet("v1/current", - async (long latitude, long longtitude, [FromServices] IGetCurrentWeatherHandler handler, CancellationToken cancellationToken) => + async (double latitude, double longtitude, [FromServices] IGetCurrentWeatherHandler handler, CancellationToken cancellationToken) => await handler.SendAsync(new GetCurrentWeatherQuery(latitude,longtitude), cancellationToken)) .Produces>() .WithName("GetCurrentWeather") @@ -36,7 +36,7 @@ await handler.SendAsync(new GetCurrentWeatherQuery(latitude,longtitude), cancell private static IEndpointRouteBuilder BuildForecastWeatherEndpoints(this IEndpointRouteBuilder endpointRouteBuilder) { endpointRouteBuilder.MapGet("v1/forecast", - async (long latitude, long longtitude, [FromServices] IGetForecastWeatherHandler handler, CancellationToken cancellationToken) => + async (double latitude, double longtitude, [FromServices] IGetForecastWeatherHandler handler, CancellationToken cancellationToken) => await handler.SendAsync(new GetForecastWeatherQuery(latitude, longtitude), cancellationToken)) .Produces>() .WithName("GetForecastWeather") diff --git a/src/Weather.Core/Configuration/ContainerConfigurationExtension.cs b/src/Weather.Core/Configuration/ContainerConfigurationExtension.cs index 24f7bda..d461959 100644 --- a/src/Weather.Core/Configuration/ContainerConfigurationExtension.cs +++ b/src/Weather.Core/Configuration/ContainerConfigurationExtension.cs @@ -15,30 +15,24 @@ namespace Weather.Core.Configuration public static class ContainerConfigurationExtension { public static IServiceCollection AddCore(this IServiceCollection serviceCollection) - { - return serviceCollection + => serviceCollection .AddValidation() .AddHandlers(); - } private static IServiceCollection AddHandlers(this IServiceCollection serviceCollection) - { - return serviceCollection + => serviceCollection .AddScoped() .AddScoped() .AddScoped() .AddScoped(); - } private static IServiceCollection AddValidation(this IServiceCollection serviceCollection) - { - return serviceCollection + => serviceCollection .AddValidotSingleton, CurrentWeatherDtoSpecificationHolder, CurrentWeatherDto>() .AddValidotSingleton, ForecastWeatherDtoSpecificationHolder, ForecastWeatherDto>() .AddValidotSingleton, LocationDtoSpecificationHolder, LocationDto>() .AddValidotSingleton, AddFavoriteCommandSpecificationHolder, AddFavoriteCommand>() .AddValidotSingleton, GetCurrentWeatherQuerySpecificationHolder, GetCurrentWeatherQuery>() .AddValidotSingleton, GetForecastWeatherSpecificationHolder, GetForecastWeatherQuery>(); - } } } diff --git a/src/Weather.Core/Validation/GeneralPredicates.cs b/src/Weather.Core/Validation/GeneralPredicates.cs index 2442070..f08a1f6 100644 --- a/src/Weather.Core/Validation/GeneralPredicates.cs +++ b/src/Weather.Core/Validation/GeneralPredicates.cs @@ -6,8 +6,8 @@ namespace Weather.Core.Validation internal static class GeneralPredicates { internal static readonly Predicate isValidTemperature = m => m < 60 && m > -90; - internal static readonly Predicate isValidLatitude = m => m >= -90 && m <= 90; - internal static readonly Predicate isValidLongtitude = m => m >= -180 && m <= 180; + internal static readonly Predicate isValidLatitude = m => m >= -90 && m <= 90; + internal static readonly Predicate isValidLongtitude = m => m >= -180 && m <= 180; internal static readonly Specification isValidLocation = s => s .Member(m => m.Latitude, m => m.Rule(isValidLatitude)) .Member(m => m.Longitude, m => m.Rule(isValidLongtitude)); diff --git a/src/Weather.Domain/Dtos/LocationDto.cs b/src/Weather.Domain/Dtos/LocationDto.cs index fe27e39..fcafd01 100644 --- a/src/Weather.Domain/Dtos/LocationDto.cs +++ b/src/Weather.Domain/Dtos/LocationDto.cs @@ -2,7 +2,7 @@ { public sealed class LocationDto { - public long Latitude { get; init; } - public long Longitude { get; init; } + public double Latitude { get; init; } + public double Longitude { get; init; } } } diff --git a/src/Weather.Domain/Queries/GetCurrentWeatherQuery.cs b/src/Weather.Domain/Queries/GetCurrentWeatherQuery.cs index b5874bd..225babd 100644 --- a/src/Weather.Domain/Queries/GetCurrentWeatherQuery.cs +++ b/src/Weather.Domain/Queries/GetCurrentWeatherQuery.cs @@ -5,7 +5,7 @@ namespace Weather.Domain.Queries public sealed class GetCurrentWeatherQuery { public LocationDto Location { get; init; } - public GetCurrentWeatherQuery(long latitude, long longtitude) + public GetCurrentWeatherQuery(double latitude, double longtitude) { Location = new LocationDto { diff --git a/src/Weather.Domain/Queries/GetForecastWeatherQuery.cs b/src/Weather.Domain/Queries/GetForecastWeatherQuery.cs index 423e77a..4ced4e8 100644 --- a/src/Weather.Domain/Queries/GetForecastWeatherQuery.cs +++ b/src/Weather.Domain/Queries/GetForecastWeatherQuery.cs @@ -5,7 +5,7 @@ namespace Weather.Domain.Queries public sealed class GetForecastWeatherQuery { public LocationDto Location { get; init; } - public GetForecastWeatherQuery(long latitude, long longtitude) + public GetForecastWeatherQuery(double latitude, double longtitude) { Location = new LocationDto { diff --git a/src/Weather.Infrastructure/Configuration/ContainerConfigurationExtension.cs b/src/Weather.Infrastructure/Configuration/ContainerConfigurationExtension.cs index e9d741b..e35f845 100644 --- a/src/Weather.Infrastructure/Configuration/ContainerConfigurationExtension.cs +++ b/src/Weather.Infrastructure/Configuration/ContainerConfigurationExtension.cs @@ -13,40 +13,30 @@ namespace Weather.Infrastructure.Configuration public static class ContainerConfigurationExtension { public static IServiceCollection AddInfrastructure(this IServiceCollection serviceCollection, IConfiguration configuration) - { - return serviceCollection + => serviceCollection .AddMapping() .AddDatabase() .AddExternalHttpServices(configuration) .AddServices(); - } private static IServiceCollection AddServices(this IServiceCollection serviceCollection) - { - return serviceCollection + => serviceCollection .AddScoped(); - } private static IServiceCollection AddMapping(this IServiceCollection serviceCollection) - { - return serviceCollection + => serviceCollection .AddAutoMapper(typeof(WeatherEntitiesProfile)) .AddAutoMapper(typeof(WeatherbitClientProfile)); - } private static IServiceCollection AddDatabase(this IServiceCollection serviceCollection) - { - return serviceCollection + => serviceCollection .AddDbContext(opt => opt.UseInMemoryDatabase("Weather")) .AddScoped() .AddScoped(); - } private static IServiceCollection AddExternalHttpServices(this IServiceCollection serviceCollection, IConfiguration configuration) - { - return serviceCollection + => serviceCollection .AddHttpClient() .AddWeatherbit(configuration); - } } } diff --git a/src/Weather.Infrastructure/Database/EFContext/Entities/FavoriteLocationEntity.cs b/src/Weather.Infrastructure/Database/EFContext/Entities/FavoriteLocationEntity.cs index 06c2c7a..40ce038 100644 --- a/src/Weather.Infrastructure/Database/EFContext/Entities/FavoriteLocationEntity.cs +++ b/src/Weather.Infrastructure/Database/EFContext/Entities/FavoriteLocationEntity.cs @@ -3,7 +3,7 @@ public sealed class FavoriteLocationEntity { public int Id { get; set; } - public long Latitude { get; set; } - public long Longitude { get; set; } + public double Latitude { get; set; } + public double Longitude { get; set; } } } diff --git a/src/Wheaterbit.Client/Abstractions/IWeatherbitHttpClient.cs b/src/Wheaterbit.Client/Abstractions/IWeatherbitHttpClient.cs index 7c5d1bd..1f0b29c 100644 --- a/src/Wheaterbit.Client/Abstractions/IWeatherbitHttpClient.cs +++ b/src/Wheaterbit.Client/Abstractions/IWeatherbitHttpClient.cs @@ -5,7 +5,7 @@ namespace Wheaterbit.Client.Abstractions { public interface IWeatherbitHttpClient { - Task> GetSixteenDayForecast(long latitude, long longitude, CancellationToken cancellationToken); - Task> GetCurrentWeather(long latitude, long longitude, CancellationToken cancellationToken); + Task> GetSixteenDayForecast(double latitude, double longitude, CancellationToken cancellationToken); + Task> GetCurrentWeather(double latitude, double longitude, CancellationToken cancellationToken); } } diff --git a/src/Wheaterbit.Client/WeatherbitHttpClient.cs b/src/Wheaterbit.Client/WeatherbitHttpClient.cs index 80fb001..519483d 100644 --- a/src/Wheaterbit.Client/WeatherbitHttpClient.cs +++ b/src/Wheaterbit.Client/WeatherbitHttpClient.cs @@ -40,7 +40,7 @@ private static void ValidateOptions(IValidator optionsValidat } } - public async Task> GetSixteenDayForecast(long latitude, long longitude, CancellationToken cancellationToken) + public async Task> GetSixteenDayForecast(double latitude, double longitude, CancellationToken cancellationToken) { var request = new HttpRequestMessage { @@ -56,7 +56,7 @@ public async Task> GetSixteenDayForecast(long latitud return await SendAsyncSave(request, cancellationToken); } - public async Task> GetCurrentWeather(long latitude, long longitude, CancellationToken cancellationToken) + public async Task> GetCurrentWeather(double latitude, double longitude, CancellationToken cancellationToken) { var request = new HttpRequestMessage {