Skip to content

Commit 2959445

Browse files
committed
Fix AddReturnTypeMetadata_ExtractsMetadataFromReturnType
1 parent e07959c commit 2959445

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
using System.Reflection;
55
using Microsoft.AspNetCore.Http;
6+
using Microsoft.AspNetCore.Http.Metadata;
67
using Microsoft.AspNetCore.Mvc.ActionConstraints;
78
using Microsoft.AspNetCore.Mvc.Filters;
89
using Microsoft.AspNetCore.Mvc.ModelBinding;
@@ -1277,8 +1278,9 @@ public void AddReturnTypeMetadata_ExtractsMetadataFromReturnType()
12771278

12781279
// Assert
12791280
Assert.NotNull(selector.EndpointMetadata);
1280-
Assert.Single(selector.EndpointMetadata);
1281-
Assert.IsType<ProducesResponseTypeMetadata>(selector.EndpointMetadata.Single());
1281+
Assert.Equal(2, selector.EndpointMetadata.Count);
1282+
Assert.Single(selector.EndpointMetadata.OfType<ProducesResponseTypeMetadata>());
1283+
Assert.Single(selector.EndpointMetadata.OfType<IApiEndpointMetadata>());
12821284
Assert.Equal(200, ((ProducesResponseTypeMetadata)selector.EndpointMetadata[0]).StatusCode);
12831285
}
12841286

0 commit comments

Comments
 (0)