System.Xml.Tests.TC_SchemaSet_Includes.v2 C# (CSharp) Method

v2() private method

private v2 ( ) : void
return void
        public void v2()
        {
            XmlSchemaSet sc = new XmlSchemaSet();
            sc.XmlResolver = new XmlUrlResolver();
            XmlSchema schema = new XmlSchema();
            sc.Add(null, TestData._XsdNoNs);
            CError.Compare(sc.Count, 1, "AddCount");
            CError.Compare(sc.IsCompiled, false, "AddIsCompiled");

            sc.Compile();
            CError.Compare(sc.IsCompiled, true, "IsCompiled");
            CError.Compare(sc.Count, 1, "Count");

            try
            {
                schema = sc.Add(null, Path.Combine(TestData._Root, "include_v2.xsd"));
            }
            catch (XmlSchemaException)
            {
                // no schema should be addded to the set.
                CError.Compare(sc.Count, 1, "Count");
                CError.Compare(sc.IsCompiled, true, "IsCompiled");
                return;
            }
            Assert.True(false);
        }