Skip to content

Commit c38d223

Browse files
author
Bart Koelman
committed
Fixed missing body assertions
1 parent 77be4ff commit c38d223

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

test/JsonApiDotNetCoreExampleTests/IntegrationTests/RequiredRelationships/DefaultBehaviorTests.cs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,12 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
114114
string route = $"/customers/{existingOrder.Customer.Id}";
115115

116116
// Act
117-
(HttpResponseMessage httpResponse, Document responseDocument) = await _testContext.ExecuteDeleteAsync<Document>(route);
117+
(HttpResponseMessage httpResponse, string responseDocument) = await _testContext.ExecuteDeleteAsync<string>(route);
118118

119119
// Assert
120120
httpResponse.Should().HaveStatusCode(HttpStatusCode.NoContent);
121121

122-
responseDocument.Should().BeNull();
122+
responseDocument.Should().BeEmpty();
123123

124124
await _testContext.RunOnDatabaseAsync(async dbContext =>
125125
{
@@ -148,12 +148,12 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
148148
string route = $"/orders/{existingOrder.Id}";
149149

150150
// Act
151-
(HttpResponseMessage httpResponse, Document responseDocument) = await _testContext.ExecuteDeleteAsync<Document>(route);
151+
(HttpResponseMessage httpResponse, string responseDocument) = await _testContext.ExecuteDeleteAsync<string>(route);
152152

153153
// Assert
154154
httpResponse.Should().HaveStatusCode(HttpStatusCode.NoContent);
155155

156-
responseDocument.Should().BeNull();
156+
responseDocument.Should().BeEmpty();
157157

158158
await _testContext.RunOnDatabaseAsync(async dbContext =>
159159
{
@@ -422,11 +422,13 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
422422
string route = $"/orders/{orderWithoutShipment.Id}";
423423

424424
// Act
425-
(HttpResponseMessage httpResponse, ErrorDocument responseDocument) = await _testContext.ExecutePatchAsync<ErrorDocument>(route, requestBody);
425+
(HttpResponseMessage httpResponse, string responseDocument) = await _testContext.ExecutePatchAsync<string>(route, requestBody);
426426

427427
// Assert
428428
httpResponse.Should().HaveStatusCode(HttpStatusCode.NoContent);
429429

430+
responseDocument.Should().BeEmpty();
431+
430432
await _testContext.RunOnDatabaseAsync(async dbContext =>
431433
{
432434
Shipment existingShipmentInDatabase =
@@ -465,11 +467,13 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
465467
string route = $"/orders/{orderWithoutShipment.Id}/relationships/shipment";
466468

467469
// Act
468-
(HttpResponseMessage httpResponse, ErrorDocument responseDocument) = await _testContext.ExecutePatchAsync<ErrorDocument>(route, requestBody);
470+
(HttpResponseMessage httpResponse, string responseDocument) = await _testContext.ExecutePatchAsync<string>(route, requestBody);
469471

470472
// Assert
471473
httpResponse.Should().HaveStatusCode(HttpStatusCode.NoContent);
472474

475+
responseDocument.Should().BeEmpty();
476+
473477
await _testContext.RunOnDatabaseAsync(async dbContext =>
474478
{
475479
Shipment existingShipmentInDatabase =

0 commit comments

Comments
 (0)