using System.Text.Json; using Shouldly; namespace Solar.Api.Tests.Extensions; public static class HttpClientExtensions { public static async Task FetchJson(this HttpClient client, string path) where T : class { var response = await client.GetAsync(path); response.EnsureSuccessStatusCode(); var result = JsonSerializer.Deserialize(await response.Content.ReadAsStringAsync()); result.ShouldNotBeNull(); return result; } }