System.Xml.Tests.CTransformResolverTest.XmlResolver5 C# (CSharp) Méthode

XmlResolver5() private méthode

private XmlResolver5 ( ) : void
Résultat void
        public void XmlResolver5()
        {
            // Skip this test for Load(URI)
            // Reason: When style sheet URI = Intranet zone, XmlSecureResolver does not resolve document function

            //if (MyInputType() == InputType.URI)
            //    return TEST_SKIPPED;

            // copy file on the local machine

            try
            {
                if (!Directory.Exists("c:\\temp"))
                {
                    Directory.CreateDirectory("c:\\temp");
                }
                string xmlFile = FullFilePath("xmlResolver_document_function.xml");
                File.Copy(xmlFile, @"c:\temp\xmlResolver_document_function.xml", true);
            }
            catch (Exception e)
            {
                _output.WriteLine(e.ToString());
                _output.WriteLine("Could not copy file to local. Some other issues prevented this test from running");
                return; //return TEST_SKIPPED;
            }

            if (LoadXSL("xmlResolver_document_function_absolute_uri.xsl") == 1)
            {
                if ((TransformResolver("fruits.xml", new XmlUrlResolver()) == 1) && (CheckResult(377.8217373898) == 1))
                    return;
                else
                {
                    _output.WriteLine("Failed to resolve document function with absolute URI.");
                    Assert.True(false);
                }
            }
            else
            {
                _output.WriteLine("Failed to load style sheet!");
                Assert.True(false);
            }
        }
    }