Repository: dotnet/aspnetcore
File: src/Mvc/Mvc.Core/test/ModelBinding/Metadata/DefaultModelMetadataProviderTest.cs (C#)

Code before:
        foreach (var property in metadata)
        {
            Assert.NotNull(property.PropertyGetter);
            Assert.Null(property.PropertyGetter(null));
        }
    }

    [Fact]
    public void GetMetadataForParameter_SuppliesEmptyAttributes_WhenParameterHasNoAttributes()
    {
        // Arrange
        var provider = CreateProvider();
        var parameters = typeof(ModelType)
            .GetMethod(nameof(ModelType.Method1))
            .GetParameters();

        // Act
        var metadata = provider.GetMetadataForParameter(parameters[0]);

        // Assert
        var defaultMetadata = Assert.IsType<DefaultModelMetadata>(metadata);

        // The parameter itself has no attributes
        Assert.Empty(defaultMetadata.Attributes.ParameterAttributes);

        // Type attributes exist (but we don't care what they are - that's CoreCLR's business)
        Assert.NotEmpty(defaultMetadata.Attributes.TypeAttributes);

        // Combined attributes = ParameterAttributes + TypeAttributes (when parameter has no attributes)
        Assert.Equal(defaultMetadata.Attributes.TypeAttributes, defaultMetadata.Attributes.Attributes);
    }

    [Fact]
    public void GetMetadataForParameter_SuppliesAttributes_WhenParamHasAttributes()
    {
        // Arrange
        var provider = CreateProvider();
        var parameters = typeof(ModelType)
            .GetMethod(nameof(ModelType.Method1))
            .GetParameters();

        // Act
        var metadata = provider.GetMetadataForParameter(parameters[1]);

        // Assert
        var defaultMetadata = Assert.IsType<DefaultModelMetadata>(metadata);
        Assert.Collection(
            // Take(2) to ignore SerializableAttribute on object.
            defaultMetadata.Attributes.Attributes.Take(2),
            attribute =>
            {

Review comment (suggestion):
```suggestion
        // Type attributes exist (but we don't care what they are - that's runtime implementation detail)
```

Code after:
        foreach (var property in metadata)
        {
            Assert.NotNull(property.PropertyGetter);
            Assert.Null(property.PropertyGetter(null));
        }
    }

    [Fact]
    public void GetMetadataForParameter_SuppliesEmptyAttributes_WhenParameterHasNoAttributes()
    {
        // Arrange
        var provider = CreateProvider();
        var parameters = typeof(ModelType)
            .GetMethod(nameof(ModelType.Method1))
            .GetParameters();

        // Act
        var metadata = provider.GetMetadataForParameter(parameters[0]);

        // Assert
        var defaultMetadata = Assert.IsType<DefaultModelMetadata>(metadata);

        // The parameter itself has no attributes
        Assert.Empty(defaultMetadata.Attributes.ParameterAttributes);

        // Type attributes exist (but we don't care what they are - that's runtime implementation detail)
        Assert.NotEmpty(defaultMetadata.Attributes.TypeAttributes);

        // Combined attributes = ParameterAttributes + TypeAttributes (when parameter has no attributes)
        Assert.Equal(defaultMetadata.Attributes.TypeAttributes, defaultMetadata.Attributes.Attributes);
    }

    [Fact]
    public void GetMetadataForParameter_SuppliesAttributes_WhenParamHasAttributes()
    {
        // Arrange
        var provider = CreateProvider();
        var parameters = typeof(ModelType)
            .GetMethod(nameof(ModelType.Method1))
            .GetParameters();

        // Act
        var metadata = provider.GetMetadataForParameter(parameters[1]);

        // Assert
        var defaultMetadata = Assert.IsType<DefaultModelMetadata>(metadata);
        Assert.Collection(
            // Take(2) to ignore SerializableAttribute on object.
            defaultMetadata.Attributes.Attributes.Take(2),
            attribute =>
            {