System.Xml.Tests.TC_SchemaSet_Imports.v7 C# (CSharp) Method

v7() private method

private v7 ( ) : void
return void
        public void v7()
        {
            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");

            sc.Add("ns-b", Path.Combine(TestData._Root, "import_v4_b.xsd")); // should be already present in the set

            CError.Compare(sc.Count, 3, "Count");
            CError.Compare(sc.IsCompiled, false, "IsCompiled");

            // 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);
        }