System.Xml.Tests.TCValidateAfterAdd.v2 C# (CSharp) Méthode

v2() private méthode

private v2 ( String testDir, String testFile, int expCount, int expCountGT, int expCountGE, int expCountGA ) : void
testDir String
testFile String
expCount int
expCountGT int
expCountGE int
expCountGA int
Résultat void
        public void v2(String testDir, String testFile, int expCount, int expCountGT, int expCountGE, int expCountGA)
        {
            Initialize();
            string xsd = Path.Combine(path, testDir, testFile + ".xsd");
            string xml = Path.Combine(path, testDir, testFile + ".xml");

            XmlSchemaSet ss = new XmlSchemaSet();
            XmlSchema Schema = XmlSchema.Read(XmlReader.Create(xsd), ValidationCallback);
            ss.XmlResolver = new XmlUrlResolver();

            XmlSchema Schema1 = ss.Add(Schema);
            ValidateSchemaSet(ss, expCount, false, 0, 0, 0, "Validation after add");
            ValidateWithXmlReader(ss, xml, xsd);

            ss.Compile();
            ValidateSchemaSet(ss, expCount, true, expCountGT, expCountGE, expCountGA, "Validation after add/comp");
            ValidateWithXmlReader(ss, xml, xsd);

            XmlSchema Schema2 = null;
            foreach (XmlSchema schema in ss.Schemas())
                Schema2 = ss.Reprocess(schema);
            ValidateSchemaSet(ss, expCount, false, 1, 0, 0, "Validation after repr");
            ValidateWithXmlReader(ss, xml, xsd);

            ss.Compile();
            ValidateSchemaSet(ss, expCount, true, expCountGT, expCountGE, expCountGA, "Validation after repr/comp");
            ValidateWithXmlReader(ss, xml, xsd);

            Assert.Equal(ss.RemoveRecursive(Schema), true);
            ValidateSchemaSet(ss, 0, false, 1, 0, 0, "Validation after remRec");
            ValidateWithXmlReader(ss, xml, xsd);

            ss.Compile();
            ValidateSchemaSet(ss, 0, true, 0, 0, 0, "Validation after add");
            ValidateWithXmlReader(ss, xml, xsd);

            return;
        }
    }