public void InferXmlSchema_inferingTables4()
{
//Acroding to the msdn documantaion :
//ms-help://MS.MSDNQTR.2003FEB.1033/cpguide/html/cpconinferringtables.htm
//The document, or root, element will result in an inferred table if it has attributes
//or child elements that will be inferred as columns.
//If the document element has no attributes and no child elements that would be inferred as columns, the element will be inferred as a DataSet
// inferingTables4
StringBuilder sb = new StringBuilder();
sb.Append("<DocumentElement>");
sb.Append("<Element1 attr1='value1' attr2='value2'/>");
sb.Append("</DocumentElement>");
var ds = new DataSet();
MemoryStream myStream = new MemoryStream(new ASCIIEncoding().GetBytes(sb.ToString()));
ds.InferXmlSchema(myStream, null);
Assert.Equal("DocumentElement", ds.DataSetName);
Assert.Equal("Element1", ds.Tables[0].TableName);
Assert.Equal(1, ds.Tables.Count);
Assert.Equal("attr1", ds.Tables[0].Columns["attr1"].ColumnName);
Assert.Equal("attr2", ds.Tables[0].Columns["attr2"].ColumnName);
}