Skip to content

Commit

Permalink
commit 5
Browse files Browse the repository at this point in the history
  • Loading branch information
philasmar committed Aug 23, 2024
1 parent 0fccdf2 commit 4ff5238
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Newtonsoft.Json.Linq;
using System.Net;
using Newtonsoft.Json.Linq;
using System.Threading.Tasks;
using NUnit.Framework;

Expand All @@ -12,7 +13,7 @@ public class CustomResponse : IntegrationTestsSetup
public async Task OkResponseWithHeader_Returns200Status()
{
var response = await HttpClient.GetAsync($"{RestApiUrlPrefix}/okresponsewithheader/1");
response.EnsureSuccessStatusCode();
Assert.That(response.StatusCode, Is.EqualTo(HttpStatusCode.OK));
Assert.That(await response.Content.ReadAsStringAsync(), Is.EqualTo("All Good"));
}

Expand All @@ -21,7 +22,7 @@ public async Task OkResponseWithHeader_Returns200Status()
public async Task OkResponseWithHeader_ReturnsValidationErrors()
{
var response = await HttpClient.GetAsync($"{RestApiUrlPrefix}/okresponsewithheader/hello");
Assert.That((int)response.StatusCode, Is.EqualTo(400));
Assert.That(response.StatusCode, Is.EqualTo(HttpStatusCode.OK));
var content = await response.Content.ReadAsStringAsync();
var errorJson = JObject.Parse(content);

Expand All @@ -34,7 +35,7 @@ public async Task OkResponseWithHeader_ReturnsValidationErrors()
public async Task OkResponseWithCustomSerializer_Returns200Status()
{
var response = await HttpClient.GetAsync($"{HttpApiUrlPrefix}/okresponsewithcustomserializerasync/John/Doe");
response.EnsureSuccessStatusCode();
Assert.That(response.StatusCode, Is.EqualTo(HttpStatusCode.OK));

var content = await response.Content.ReadAsStringAsync();
var person = JObject.Parse(content);
Expand Down

0 comments on commit 4ff5238

Please sign in to comment.