SpeckleHttp coverage (#244)

* Show code coverage for dev

* SpeckleHttp coverage and moved base stuff around

* add SpeckleHttpTests
This commit is contained in:
Adam Hathcock
2025-03-07 10:48:01 +00:00
committed by GitHub
parent 15fa319433
commit 9695ec8c51
66 changed files with 509 additions and 85 deletions
@@ -15,10 +15,15 @@ public class SpeckleHttp(ILogger<SpeckleHttp> logger, ISpeckleHttpClientHandlerF
/// <param name="uri">The URI that should be pinged</param>
/// <exception cref="System.Net.Http.HttpRequestException">Request to <paramref name="uri"/> failed</exception>
public async Task<HttpResponseMessage> HttpPing(Uri uri)
{
using var httpClient = CreateHttpClient();
return await HttpPing(uri, httpClient).ConfigureAwait(false);
}
public async Task<HttpResponseMessage> HttpPing(Uri uri, HttpClient httpClient)
{
try
{
using var httpClient = CreateHttpClient();
HttpResponseMessage response = await httpClient.GetAsync(uri).ConfigureAwait(false);
response.EnsureSuccessStatusCode();
logger.LogInformation("Successfully pinged {uri}", uri);