public void ReadSimpleAuto()
{
DataSet ds;
// empty XML
ds = new DataSet();
AssertReadXml(ds, "EmptyString", xml1,
XmlReadMode.Auto, XmlReadMode.Auto,
"NewDataSet", 0);
// simple element
ds = new DataSet();
AssertReadXml(ds, "EmptyElement", xml2,
XmlReadMode.Auto, XmlReadMode.InferSchema,
"root", 0);
// simple element2
ds = new DataSet();
AssertReadXml(ds, "StartEndTag", xml3,
XmlReadMode.Auto, XmlReadMode.InferSchema,
"root", 0);
// whitespace in simple element
ds = new DataSet();
AssertReadXml(ds, "Whitespace", xml4,
XmlReadMode.Auto, XmlReadMode.InferSchema,
"root", 0);
// text in simple element
ds = new DataSet();
AssertReadXml(ds, "SingleText", xml5,
XmlReadMode.Auto, XmlReadMode.InferSchema,
"root", 0);
// simple table pattern:
// root becomes a table and test becomes a column.
ds = new DataSet();
AssertReadXml(ds, "SimpleTable", xml6,
XmlReadMode.Auto, XmlReadMode.InferSchema,
"NewDataSet", 1);
AssertDataTable("xml6", ds.Tables[0], "root", 1, 1, 0, 0, 0, 0);
// simple table with 2 columns:
ds = new DataSet();
AssertReadXml(ds, "SimpleTable2", xml7,
XmlReadMode.Auto, XmlReadMode.InferSchema,
"NewDataSet", 1);
AssertDataTable("xml7", ds.Tables[0], "root", 2, 1, 0, 0, 0, 0);
// simple dataset with 1 table:
ds = new DataSet();
AssertReadXml(ds, "SimpleDataSet", xml8,
XmlReadMode.Auto, XmlReadMode.InferSchema,
"dataset", 1);
AssertDataTable("xml8", ds.Tables[0], "table", 2, 1, 0, 0, 0, 0);
}