Browse Source
Dispose HttpRequestMessage in tests
pull/25105/head
maliming
7 months ago
No known key found for this signature in database
GPG Key ID: A646B9CB645ECEA4
2 changed files with
2 additions and
2 deletions
-
framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Validation/FluentValidationTestAppService_Tests.cs
-
framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Validation/ValidationTestController_Tests.cs
|
|
|
@ -53,7 +53,7 @@ public class FluentValidationTestAppService_Tests : AspNetCoreMvcTestBase |
|
|
|
|
|
|
|
private async Task<HttpResponseMessage> PostAsync(string jsonContent) |
|
|
|
{ |
|
|
|
var request = new HttpRequestMessage(HttpMethod.Post, "/api/app/fluent-validation-test") |
|
|
|
using var request = new HttpRequestMessage(HttpMethod.Post, "/api/app/fluent-validation-test") |
|
|
|
{ |
|
|
|
Content = new StringContent(jsonContent, Encoding.UTF8, "application/json") |
|
|
|
}; |
|
|
|
|
|
|
|
@ -121,7 +121,7 @@ public class ValidationTestController_Tests : AspNetCoreMvcTestBase |
|
|
|
// FluentValidationTestInput has a FluentValidator with MinimumLength(3) rule,
|
|
|
|
// but this is a regular AbpController (not IValidationEnabled),
|
|
|
|
// so FluentValidation should NOT be triggered.
|
|
|
|
var request = new HttpRequestMessage(HttpMethod.Post, "/api/validation-test/fluent-validation-action") |
|
|
|
using var request = new HttpRequestMessage(HttpMethod.Post, "/api/validation-test/fluent-validation-action") |
|
|
|
{ |
|
|
|
Content = new StringContent("{\"name\": \"A\"}", Encoding.UTF8, "application/json") |
|
|
|
}; |
|
|
|
|