From 123380a932f8f1eb4ec697501e203486f839c71c Mon Sep 17 00:00:00 2001 From: Safia Abdalla Date: Thu, 29 Jul 2021 13:24:00 -0500 Subject: [PATCH] Use plain ActionDescriptor in test --- .../SwaggerGenerator/SwaggerGeneratorTests.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/test/Swashbuckle.AspNetCore.SwaggerGen.Test/SwaggerGenerator/SwaggerGeneratorTests.cs b/test/Swashbuckle.AspNetCore.SwaggerGen.Test/SwaggerGenerator/SwaggerGeneratorTests.cs index e16be1509d..c64f41c898 100644 --- a/test/Swashbuckle.AspNetCore.SwaggerGen.Test/SwaggerGenerator/SwaggerGeneratorTests.cs +++ b/test/Swashbuckle.AspNetCore.SwaggerGen.Test/SwaggerGenerator/SwaggerGeneratorTests.cs @@ -3,7 +3,7 @@ using System.Reflection; using System.Text.Json; using Microsoft.AspNetCore.Mvc.ApiExplorer; -using Microsoft.AspNetCore.Mvc.Controllers; +using Microsoft.AspNetCore.Mvc.Abstractions; using Microsoft.OpenApi.Models; using Microsoft.AspNetCore.Mvc.ModelBinding; using Microsoft.AspNetCore.Routing; @@ -84,11 +84,8 @@ public void GetSwagger_SetsOperationIdToRouteName_IfActionHasRouteNameMetadata() public void GetSwagger_SetsOperationIdToEndpointName_IfActionHasEndpointNameMetadata() { var methodInfo = typeof(FakeController).GetMethod(nameof(FakeController.ActionWithParameter)); - var actionDescriptor = new ControllerActionDescriptor + var actionDescriptor = new ActionDescriptor { - ControllerTypeInfo = methodInfo.DeclaringType.GetTypeInfo(), - ControllerName = methodInfo.DeclaringType.Name, - MethodInfo = methodInfo, EndpointMetadata = new List() { new EndpointNameMetadata("SomeEndpointName") }, RouteValues = new Dictionary {