private async Task AssertGetResponse()

in CachingProxyTests/src/CachingProxyTest.cs [485:498]


    private async Task AssertGetResponse(string url, HttpStatusCode expectedCode,
      Action<HttpResponseMessage, byte[]> assertions)
    {
      myOutput.WriteLine("*** GET " + url);
      using var response = await myServer.CreateClient().GetAsync(url);
      var bytes = await response.Content.ReadAsByteArrayAsync();

      myOutput.WriteLine(response.ToString());
      if (bytes.All(c => c < 128) && bytes.Length < 200)
        myOutput.WriteLine("Body: " + Encoding.UTF8.GetString(bytes));

      Assert.Equal(expectedCode, response.StatusCode);
      assertions(response, bytes);
    }