public void TestSampleFileSimpleTables()
{
var ds = new DataSet();
ds.ReadXmlSchema(new StringReader(
@"<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'>
<xs:element name='foo' type='ct' />
<xs:complexType name='ct'>
<xs:simpleContent>
<xs:extension base='xs:integer'>
<xs:attribute name='attr' />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:schema>"));
AssertDataSet("005", ds, "NewDataSet", 1, 0);
DataTable dt = ds.Tables[0];
AssertDataTable("tab", dt, "foo", 2, 0, 0, 0, 0, 0);
AssertDataColumn("attr", dt.Columns[0], "attr", true, false, 0, 1, "attr", MappingType.Attribute, typeof(string), DBNull.Value, string.Empty, -1, string.Empty, 0, string.Empty, false, false);
AssertDataColumn("text", dt.Columns[1], "foo_text", false, false, 0, 1, "foo_text", MappingType.SimpleContent, typeof(long), DBNull.Value, string.Empty, -1, string.Empty, 1, string.Empty, false, false);
ds = new DataSet();
ds.ReadXmlSchema(new StringReader(
@"<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'>
<xs:element name='foo' type='st' />
<xs:complexType name='st'>
<xs:attribute name='att1' />
<xs:attribute name='att2' type='xs:int' default='2' />
</xs:complexType>
</xs:schema>"));
AssertDataSet("006", ds, "NewDataSet", 1, 0);
dt = ds.Tables[0];
AssertDataTable("tab", dt, "foo", 2, 0, 0, 0, 0, 0);
AssertDataColumn("att1", dt.Columns["att1"], "att1", true, false, 0, 1, "att1", MappingType.Attribute, typeof(string), DBNull.Value, string.Empty, -1, string.Empty, /*0*/-1, string.Empty, false, false);
AssertDataColumn("att2", dt.Columns["att2"], "att2", true, false, 0, 1, "att2", MappingType.Attribute, typeof(int), 2, string.Empty, -1, string.Empty, /*1*/-1, string.Empty, false, false);
}