Skip to content

Commit 9485e7f

Browse files
committed
Fixup test
1 parent 5317344 commit 9485e7f

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/Mvc/test/Mvc.FunctionalTests/InputObjectValidationTests.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,13 @@ public async Task ValidationThrowsError_WhenValidationExceedsMaxValidationDepth(
261261
Content = new StringContent(@"{ ""Id"": ""S-1-5-21-1004336348-1177238915-682003330-512"" }", Encoding.UTF8, "application/json"),
262262
};
263263

264-
// Act & Assert
265-
var ex = await Assert.ThrowsAsync<InvalidOperationException>(() => Client.SendAsync(requestMessage));
266-
Assert.Equal(expected, ex.Message);
264+
// Act
265+
var response = await Client.SendAsync(requestMessage);
266+
267+
// Assert
268+
await response.AssertStatusCodeAsync(HttpStatusCode.InternalServerError);
269+
var content = await response.Content.ReadAsStringAsync();
270+
Assert.Contains(expected, content);
267271
}
268272

269273
[Fact]
@@ -356,4 +360,4 @@ public async Task ErrorsDeserializingMalformedXml_AreReportedForModelsWithoutAny
356360
});
357361
}
358362
}
359-
}
363+
}

0 commit comments

Comments
 (0)