Browse Source

Dispose HttpRequestMessage in tests

pull/25105/head
maliming 7 months ago
parent
commit
b21747c63b
No known key found for this signature in database GPG Key ID: A646B9CB645ECEA4
  1. 2
      framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Validation/FluentValidationTestAppService_Tests.cs
  2. 2
      framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Validation/ValidationTestController_Tests.cs

2
framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Validation/FluentValidationTestAppService_Tests.cs

@ -53,7 +53,7 @@ public class FluentValidationTestAppService_Tests : AspNetCoreMvcTestBase
private async Task<HttpResponseMessage> PostAsync(string jsonContent) 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") Content = new StringContent(jsonContent, Encoding.UTF8, "application/json")
}; };

2
framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Validation/ValidationTestController_Tests.cs

@ -121,7 +121,7 @@ public class ValidationTestController_Tests : AspNetCoreMvcTestBase
// FluentValidationTestInput has a FluentValidator with MinimumLength(3) rule, // FluentValidationTestInput has a FluentValidator with MinimumLength(3) rule,
// but this is a regular AbpController (not IValidationEnabled), // but this is a regular AbpController (not IValidationEnabled),
// so FluentValidation should NOT be triggered. // 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") Content = new StringContent("{\"name\": \"A\"}", Encoding.UTF8, "application/json")
}; };

Loading…
Cancel
Save