System.Data.Tests.DataTableTest3.XmlSchemaTest2 C# (CSharp) Method

XmlSchemaTest2() private method

private XmlSchemaTest2 ( ) : void
return void
        public void XmlSchemaTest2()
        {
            MakeParentTable();

            _dataSet.Tables.Remove(_parentTable);
            _parentTable.TableName = string.Empty;

            using (FileStream stream = new FileStream(_tempFile, FileMode.Create))
            {
                try
                {
                    _parentTable.WriteXmlSchema(stream);
                    Assert.False(true);
                }
                catch (InvalidOperationException ex)
                {
                    Assert.Equal(typeof(InvalidOperationException), ex.GetType());
                    Assert.Null(ex.InnerException);
                    Assert.NotNull(ex.Message);
                }
            }
        }