System.Xml.Tests.TC_SchemaSet_Imports.v6 C# (CSharp) Méthode

v6() private méthode

private v6 ( ) : void
Résultat void
        public void v6()
        {
            XmlSchemaSet sc = new XmlSchemaSet();
            sc.XmlResolver = new XmlUrlResolver();

            XmlSchema parent = sc.Add(null, Path.Combine(TestData._Root, "import_v5_a.xsd"));
            CError.Compare(sc.IsCompiled, false, "AddIsCompiled");
            CError.Compare(sc.Count, 2, "AddCount");

            sc.Compile();
            CError.Compare(sc.IsCompiled, true, "CompileIsCompiled");
            CError.Compare(sc.Count, 2, "CompileCount");

            XmlSchema orig = sc.Add(null, Path.Combine(TestData._Root, "import_v4_b.xsd")); // should be already present in the set

            CError.Compare(sc.IsCompiled, true, "Add2IsCompiled");
            CError.Compare(sc.Count, 2, "Add2Count");
            CError.Compare(orig.SourceUri.Contains("import_v4_b.xsd"), true, "Compare the schema object");
            // check that schema is present in parent.Includes and its NS correct.
            foreach (XmlSchemaImport imp in parent.Includes)
                if (imp.SchemaLocation.Equals("import_v4_b.xsd") && imp.Schema.TargetNamespace == null)
                    return;

            Assert.True(false);
        }