public void Bug420862()
{
DataSet ds = new DataSet("d");
DataTable dt = ds.Tables.Add("t");
dt.Columns.Add("c", typeof(ushort));
XmlSchema xs = XmlSchema.Read(new StringReader(ds.GetXmlSchema()), null);
#pragma warning disable 0618
xs.Compile(null);
#pragma warning restore 0618
// follow the nesting of the schema in the foreach
foreach (XmlSchemaElement d in xs.Items)
{
Assert.Equal("d", d.Name);
XmlSchemaChoice dsc = (XmlSchemaChoice)((XmlSchemaComplexType)d.SchemaType).Particle;
foreach (XmlSchemaElement t in dsc.Items)
{
Assert.Equal("t", t.Name);
XmlSchemaSequence tss = (XmlSchemaSequence)((XmlSchemaComplexType)t.SchemaType).Particle;
foreach (XmlSchemaElement c in tss.Items)
{
Assert.Equal("c", c.Name);
Assert.Equal("unsignedShort", c.SchemaTypeName.Name);
return;
}
}
}
Assert.False(true);
}