From cf251bff1717670c8186409195e07530bf1896ef Mon Sep 17 00:00:00 2001 From: Maxwell Date: Mon, 2 Oct 2023 09:17:34 +0300 Subject: [PATCH] Tweak test for HttpApiResponseException>message --- tests/Tingle.Extensions.Http.Tests/ResourceResponseTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Tingle.Extensions.Http.Tests/ResourceResponseTests.cs b/tests/Tingle.Extensions.Http.Tests/ResourceResponseTests.cs index c260fef..55191eb 100644 --- a/tests/Tingle.Extensions.Http.Tests/ResourceResponseTests.cs +++ b/tests/Tingle.Extensions.Http.Tests/ResourceResponseTests.cs @@ -49,7 +49,7 @@ public void EnsureSuccess_Throws_Exception() { var response = new HttpResponseMessage(HttpStatusCode.NotFound); response.Headers.Date = new DateTimeOffset(DateTimeOffset.UtcNow.Date, TimeSpan.Zero); - response.Content = new StringContent(string.Empty); + response.Content = new StringContent("{\"status\":404}"); var options = new DummyHttpApiClientOptions { @@ -62,7 +62,7 @@ public void EnsureSuccess_Throws_Exception() var message = "The HTTP request failed with code 404 (NotFound)\n" + $"\nHeaders:\n{{\"Date\":[\"{response.Headers.Date:r}\"],\"Content-Type\":[\"text/plain; charset=utf-8\"]}}\n" - + "\nBody:\n"; + + "\nBody:\n{\"status\":404}"; var ex = Assert.Throws(rr.EnsureSuccess); Assert.Equal(message, ex.Message);