System.Xml.Tests.TC_SchemaSet_Misc.Dev10_40561 C# (CSharp) Method

Dev10_40561() private method

private Dev10_40561 ( ) : void
return void
        public void Dev10_40561()
        {
            Initialize();
            string xml = @"<?xml version='1.0' encoding='utf-8'?><e1 xmlns='ns-a'>  <c23 xmlns='ns-b'/></e1>";
            XmlSchemaSet set = new XmlSchemaSet();
            set.XmlResolver = new XmlUrlResolver();
            string path = Path.Combine(TestData.StandardPath, "xsd10", "SCHEMA", "schN11_a.xsd");
            set.Add(null, path);
            set.Compile();

            XmlReaderSettings settings = new XmlReaderSettings();
            settings.ValidationType = ValidationType.Schema;
            settings.Schemas = set;

            using (XmlReader reader = XmlReader.Create(new StringReader(xml), settings))
            {
                try
                {
                    while (reader.Read()) ;
                    _output.WriteLine("XmlSchemaValidationException was not thrown");
                    Assert.True(false);
                }
                catch (XmlSchemaValidationException e) { _output.WriteLine(e.Message); }
            }
            CError.Compare(warningCount, 0, "Warning Count mismatch!");
            CError.Compare(errorCount, 0, "Error Count mismatch!");
            return;
        }