System.Xml.Tests.CLoadReaderTest.LoadXmlReader2 C# (CSharp) Method

LoadXmlReader2() private method

private LoadXmlReader2 ( ) : void
return void
        public void LoadXmlReader2()
        {
#pragma warning disable 0618
            xslt = new XslTransform();

            XmlValidatingReader xrTemp = new XmlValidatingReader(new XmlTextReader(FullFilePath("showParam.xsl")));
#pragma warning restore 0618
            xrTemp.ValidationType = ValidationType.None;
            xrTemp.EntityHandling = EntityHandling.ExpandEntities;
            xrTemp.Dispose();

            try
            {
                xslt.Load(xrTemp);
            }
            catch (System.Xml.Xsl.XsltCompileException e)
            {
                CheckExpectedError(e.InnerException, "system.xml", "Xslt_WrongStylesheetElement", new string[] { "" });
                return;
            }
            _output.WriteLine("No exception thrown for a loading a closed reader!");
            Assert.True(false);
        }