public void XmlTest24()
{
MakeDummyTable();
using (FileStream stream = new FileStream(_tempFile, FileMode.Create))
{
_dummyTable.WriteXml(stream, XmlWriteMode.DiffGram);
}
//This test is the same for case when the table name is set but no schema is defined
using (FileStream stream = new FileStream(_tempFile, FileMode.Open))
{
DataTable table = new DataTable();
try
{
table.ReadXml(stream);
Assert.False(true);
}
catch (InvalidOperationException ex)
{
Assert.Equal(typeof(InvalidOperationException), ex.GetType());
Assert.Null(ex.InnerException);
Assert.NotNull(ex.Message);
}
}
}