Use wrapper class for get all api endpoints
All checks were successful
continuous-integration/drone/push Build is passing

To enable e.g. pagination in the future
This commit is contained in:
2024-08-25 13:39:00 +02:00
parent 136dd2311d
commit d6c75654b0
4 changed files with 80 additions and 35 deletions

View File

@@ -42,8 +42,8 @@ public class GetConsumptionsTests : IAsyncLifetime
// Assert
response.StatusCode.Should().Be(HttpStatusCode.OK);
var consumptions = await response.Content.ReadFromJsonAsync<List<GetConsumptions.Response>>();
consumptions.Should().BeEquivalentTo(createdConsumptions);
var apiResponse = await response.Content.ReadFromJsonAsync<GetConsumptions.ApiResponse>();
apiResponse!.Consumptions.Should().BeEquivalentTo(createdConsumptions);
}
[Fact]
@@ -56,8 +56,8 @@ public class GetConsumptionsTests : IAsyncLifetime
// Assert
response.StatusCode.Should().Be(HttpStatusCode.OK);
var consumptions = await response.Content.ReadFromJsonAsync<List<GetConsumptions.Response>>();
consumptions.Should().BeEmpty();
var apiResponse = await response.Content.ReadFromJsonAsync<GetConsumptions.ApiResponse>();
apiResponse!.Consumptions.Should().BeEmpty();
}
private async Task<CreateConsumption.Response> CreateConsumptionAsync()