Skip to content

[wasm] Enable System.Xml.Linq.Tests.XTypeDescriptionProviderTests class #39709

@MaximLipnin

Description

@MaximLipnin

While enabling System.ComponentModel.TypeConverter.Tests on Browser WASM, I faced the failures in System.Xml.Linq.Tests.XTypeDescriptionProviderTests test class.

There are 7 test cases which mostly test the property-related logic for XElement and XAttribute classes (dotnet/corefx#33082).
Those classes are annotated with System.ComponentModel.TypeDescriptionProviderAttribute so that TypeDescriptor.GetProperties() can provide with some additional properties

public override PropertyDescriptorCollection GetProperties(Attribute[] attributes)
{
PropertyDescriptorCollection properties = new PropertyDescriptorCollection(null);
if (attributes == null)
{
if (typeof(T) == typeof(XElement))
{
properties.Add(new XElementAttributePropertyDescriptor());
properties.Add(new XElementDescendantsPropertyDescriptor());
properties.Add(new XElementElementPropertyDescriptor());
properties.Add(new XElementElementsPropertyDescriptor());
properties.Add(new XElementValuePropertyDescriptor());
properties.Add(new XElementXmlPropertyDescriptor());
}
else if (typeof(T) == typeof(XAttribute))
{
properties.Add(new XAttributeValuePropertyDescriptor());
}
}
foreach (PropertyDescriptor property in base.GetProperties(attributes))
{
properties.Add(property);
}
return properties;
}
}
.

The mentioned tests get a collection of property descriptors by calling something like below

var xel = new XElement("someElement");
var props = TypeDescriptor.GetProperties(xel);

Actually props contains only a collection of some general properties and doesn't include the additional ones.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions