Skip to content

Commit

Permalink
Tweak test for HttpApiResponseException>message
Browse files Browse the repository at this point in the history
  • Loading branch information
mburumaxwell committed Oct 2, 2023
1 parent 5601578 commit cf251bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/Tingle.Extensions.Http.Tests/ResourceResponseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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<HttpApiResponseException>(rr.EnsureSuccess);
Assert.Equal(message, ex.Message);

Expand Down

0 comments on commit cf251bf

Please sign in to comment.