System.Xml.Tests.TC_SchemaSet_Reprocess.v8 C# (CSharp) Méthode

v8() private méthode

private v8 ( ) : void
Résultat void
        public void v8()
        {
            bWarningCallback = false;
            bErrorCallback = false;

            XmlSchemaSet sc = new XmlSchemaSet();
            sc.XmlResolver = new XmlUrlResolver();
            sc.ValidationEventHandler += new ValidationEventHandler(ValidationCallback);

            XmlSchema Schema1 = sc.Add(null, Path.Combine(TestData._Root, "import_v1_a.xsd"));
            CError.Compare(sc.Count, 2, "Count after add");
            CError.Compare(sc.Contains(Schema1), true, "Contains after add");

            sc.Compile();
            CError.Compare(sc.Count, 2, "Count");
            CError.Compare(sc.Contains(Schema1), true, "Contains");

            //edit
            foreach (XmlSchemaImport imp in Schema1.Includes)
            {
                imp.SchemaLocation = "bogus";
                imp.Schema = null;
            }

            sc.Reprocess(Schema1);

            CError.Compare(bWarningCallback, true, "Warning");
            CError.Compare(bErrorCallback, false, "Error");

            CError.Compare(sc.Count, 2, "Count");
            CError.Compare(sc.Contains(Schema1), true, "Contains");
            CError.Compare(sc.IsCompiled, false, "IsCompiled");

            sc.Compile();

            CError.Compare(sc.IsCompiled, true, "IsCompiled");
            CError.Compare(Schema1.IsCompiled, true, "IsCompiled on SOM");

            return;
        }