System.Xml.Tests.TCXmlSchemaValidatorMisc.NullPointerExceptionInXSDValidation C# (CSharp) Method

NullPointerExceptionInXSDValidation() private method

private NullPointerExceptionInXSDValidation ( ) : void
return void
        public void NullPointerExceptionInXSDValidation()
        {
            Initialize();

            XmlSchemaSet ss = new XmlSchemaSet();
            XmlSchema Schema = XmlSchema.Read(XmlReader.Create(new StringReader(xsd445844)), ValidationCallback);
            ss.Add(Schema);
            ss.Compile();

            XmlReaderSettings rs = new XmlReaderSettings();
            rs.ValidationEventHandler += new ValidationEventHandler(ValidationCallback);
            rs.ValidationType = ValidationType.Schema;
            rs.Schemas.Add("http://tempuri.org/XMLSchema.xsd", XmlReader.Create(new StringReader(xsd445844)));

            using (XmlReader r = XmlReader.Create(new StringReader(xml445844), rs))
            {
                while (r.Read()) ;
            }

            Assert.Equal(warningCount, 0);
            Assert.Equal(errorCount, 0);
            return;
        }