Use concrete types
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-06-24 19:28:55 +02:00
parent 8681247e76
commit ab32be98a6
20 changed files with 48 additions and 48 deletions

View File

@@ -37,7 +37,7 @@ public class GetConsumptionTests : IAsyncLifetime
// Assert
string content = await response.Content.ReadAsStringAsync();
response.StatusCode.Should().Be(HttpStatusCode.OK);
var consumption = await response.Content.ReadFromJsonAsync<GetConsumption.Response>();
GetConsumption.Response? consumption = await response.Content.ReadFromJsonAsync<GetConsumption.Response>();
consumption.Should().BeEquivalentTo(createdConsumption);
}
@@ -45,7 +45,7 @@ public class GetConsumptionTests : IAsyncLifetime
public async Task GetConsumptions_ShouldReturnNotFound_WhenConsumptionDoesNotExist()
{
// Arrange
var consumptionId = Guid.NewGuid();
Guid consumptionId = Guid.NewGuid();
// Act
using HttpResponseMessage response = await _factory.HttpClient.GetAsync($"v1/consumptions{consumptionId}");
@@ -60,7 +60,7 @@ public class GetConsumptionTests : IAsyncLifetime
CreateConsumption.Request createConsumptionRequest = _consumptionFaker.CreateConsumptionRequest(createdCarResponse.Id);
using HttpResponseMessage response = await _factory.HttpClient.PostAsJsonAsync("v1/consumptions", createConsumptionRequest);
response.EnsureSuccessStatusCode();
var createdConsumption = await response.Content.ReadFromJsonAsync<CreateConsumption.Response>();
CreateConsumption.Response? createdConsumption = await response.Content.ReadFromJsonAsync<CreateConsumption.Response>();
return createdConsumption!;
}
@@ -69,7 +69,7 @@ public class GetConsumptionTests : IAsyncLifetime
CreateCar.Request createCarRequest = new CarFaker().CreateCarRequest();
using HttpResponseMessage createCarResponse = await _factory.HttpClient.PostAsJsonAsync("v1/cars", createCarRequest);
createCarResponse.EnsureSuccessStatusCode();
var createdCarResponse = await createCarResponse.Content.ReadFromJsonAsync<CreateCar.Response>();
CreateCar.Response? createdCarResponse = await createCarResponse.Content.ReadFromJsonAsync<CreateCar.Response>();
return createdCarResponse!;
}