System.Xml.Tests.TC_SchemaSet_RemoveRecursive.v4 C# (CSharp) Méthode

v4() private méthode

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

            try
            {
                // remove after compile
                XmlSchema Schema1 = sc.Add(null, TestData._XsdAuthor);
                XmlSchema Schema2 = sc.Add(null, Path.Combine(TestData._Root, fileName)); // param as filename
                sc.Compile();
                sc.RemoveRecursive(Schema2);
                CError.Compare(sc.Count, 1, "Count");
                ICollection Col = sc.Schemas();
                CError.Compare(Col.Count, 1, "ICollection.Count");

                //remove before compile
                Schema2 = sc.Add(null, Path.Combine(TestData._Root, fileName)); // param as filename
                CError.Compare(sc.Count, 2, "Count");
                sc.RemoveRecursive(Schema2);
                CError.Compare(sc.Count, 1, "Count");
                Col = sc.Schemas();
                CError.Compare(Col.Count, 1, "ICollection.Count");
            }
            catch (Exception e)
            {
                _output.WriteLine(e.ToString());
                Assert.True(false);
            }

            return;
        }