Skip to content

Commit ba35930

Browse files
committed
Fix GetDescriptors_ActionWithMultipleHttpMethods_LastHttpMethodMetadata
1 parent 88a45ce commit ba35930

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Mvc/Mvc.Core/test/ApplicationModels/ControllerActionDescriptorProviderTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ public void GetDescriptors_ActionWithHttpMethods_AddedToEndpointMetadata()
304304
}
305305

306306
[Fact]
307-
public void GetDescriptors_ActionWithMultipleHttpMethods_SingleHttpMethodMetadata()
307+
public void GetDescriptors_ActionWithMultipleHttpMethods_LastHttpMethodMetadata()
308308
{
309309
// Arrange & Act
310310
var descriptors = GetDescriptors(
@@ -329,9 +329,9 @@ Action<ControllerActionDescriptor> InspectElement(string httpMethod)
329329
var httpMethodAttribute = Assert.Single(descriptor.EndpointMetadata.OfType<HttpMethodAttribute>());
330330
Assert.Equal(httpMethod, httpMethodAttribute.HttpMethods.Single(), ignoreCase: true);
331331

332-
var httpMethodMetadata = Assert.Single(descriptor.EndpointMetadata.OfType<IHttpMethodMetadata>());
333-
Assert.Equal(httpMethod, httpMethodMetadata.HttpMethods.Single(), ignoreCase: true);
334-
Assert.False(httpMethodMetadata.AcceptCorsPreflight);
332+
var lastHttpMethodMetadata = descriptor.EndpointMetadata.OfType<IHttpMethodMetadata>().Last();
333+
Assert.Equal(httpMethod, lastHttpMethodMetadata.HttpMethods.Single(), ignoreCase: true);
334+
Assert.False(lastHttpMethodMetadata.AcceptCorsPreflight);
335335
};
336336
}
337337
}

0 commit comments

Comments
 (0)