Skip to content

Commit

Permalink
chore: improve test
Browse files Browse the repository at this point in the history
  • Loading branch information
daveleek committed Dec 7, 2023
1 parent 8f319a3 commit c0dd60e
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ public async Task Headers()
jsonSerializer.TryLoad();
var messageHandler = new InvokingMessageHandler((message) => {
Assert.AreEqual(true, message.Content.Headers.Contains("Content-Length"), "Content-Length header is not set");
Assert.AreEqual("183", message.Content.Headers.GetValues("Content-Length").First(), "Content-Length header value mismatch");

Assert.IsTrue(Int32.TryParse(message.Content.Headers.GetValues("Content-Length").First(), out var contentLength), "Content-Length header value is not a number");
Assert.Greater(contentLength, 0, "Content-Length header value is not greater than 0");
});
var client = new HttpClient(messageHandler);
client.BaseAddress = new Uri("http://localhost:8080/api/");
Expand Down

0 comments on commit c0dd60e

Please sign in to comment.