Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,14 @@ public void GetMetadataForParameter_SuppliesEmptyAttributes_WhenParameterHasNoAt
// Assert
var defaultMetadata = Assert.IsType<DefaultModelMetadata>(metadata);

// Not exactly "no attributes" due to SerializableAttribute on object.
Assert.IsType<SerializableAttribute>(Assert.Single(defaultMetadata.Attributes.Attributes));
// 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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,15 @@ public void GetAttributesForParameter_NoAttributes()
.GetParameters()[0]);

// Assert
// Not exactly "no attributes" due to SerializableAttribute on object.
Assert.IsType<SerializableAttribute>(Assert.Single(attributes.Attributes));
// The parameter itself has no attributes
Assert.Empty(attributes.ParameterAttributes);
Assert.Null(attributes.PropertyAttributes);
Assert.Equal(attributes.Attributes, attributes.TypeAttributes);

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

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

[Fact]
Expand Down
Loading