Exemplo n.º 1
0
        [Fact] // ctor (Boolean, String)
        public void Constructor4()
        {
            transform = new UnprotectedXmlDsigExcC14NTransform(true, null);
            Assert.Equal("http://www.w3.org/2001/10/xml-exc-c14n#WithComments", XmlNameSpace.Url[transform.Algorithm]);
            Assert.Null(transform.InclusiveNamespacesPrefixList);
            CheckProperties(transform);

            transform = new UnprotectedXmlDsigExcC14NTransform(true, string.Empty);
            Assert.Equal("http://www.w3.org/2001/10/xml-exc-c14n#WithComments", XmlNameSpace.Url[transform.Algorithm]);
            Assert.Equal(string.Empty, transform.InclusiveNamespacesPrefixList);
            CheckProperties(transform);

            transform = new UnprotectedXmlDsigExcC14NTransform(true, "#default xsd");
            Assert.Equal("http://www.w3.org/2001/10/xml-exc-c14n#WithComments", XmlNameSpace.Url[transform.Algorithm]);
            Assert.Equal("#default xsd", transform.InclusiveNamespacesPrefixList);
            CheckProperties(transform);

            transform = new UnprotectedXmlDsigExcC14NTransform(false, null);
            Assert.Equal("http://www.w3.org/2001/10/xml-exc-c14n#", XmlNameSpace.Url[transform.Algorithm]);
            Assert.Null(transform.InclusiveNamespacesPrefixList);
            CheckProperties(transform);

            transform = new UnprotectedXmlDsigExcC14NTransform(false, string.Empty);
            Assert.Equal("http://www.w3.org/2001/10/xml-exc-c14n#", XmlNameSpace.Url[transform.Algorithm]);
            Assert.Equal(string.Empty, transform.InclusiveNamespacesPrefixList);
            CheckProperties(transform);

            transform = new UnprotectedXmlDsigExcC14NTransform(false, "#default xsd");
            Assert.Equal("http://www.w3.org/2001/10/xml-exc-c14n#", XmlNameSpace.Url[transform.Algorithm]);
            Assert.Equal("#default xsd", transform.InclusiveNamespacesPrefixList);
            CheckProperties(transform);
        }
        [Fact] // ctor (Boolean)
        public void Constructor2()
        {
            transform = new UnprotectedXmlDsigExcC14NTransform(true);
            Assert.Equal("http://www.w3.org/2001/10/xml-exc-c14n#WithComments", transform.Algorithm);
            Assert.Null(transform.InclusiveNamespacesPrefixList);
            CheckProperties(transform);

            transform = new UnprotectedXmlDsigExcC14NTransform(false);
            Assert.Equal("http://www.w3.org/2001/10/xml-exc-c14n#", transform.Algorithm);
            Assert.Null(transform.InclusiveNamespacesPrefixList);
            CheckProperties(transform);
        }
        [Fact] // ctor (String)
        public void Constructor3()
        {
            transform = new UnprotectedXmlDsigExcC14NTransform(null);
            Assert.Equal("http://www.w3.org/2001/10/xml-exc-c14n#", transform.Algorithm);
            Assert.Null(transform.InclusiveNamespacesPrefixList);
            CheckProperties(transform);

            transform = new UnprotectedXmlDsigExcC14NTransform(string.Empty);
            Assert.Equal("http://www.w3.org/2001/10/xml-exc-c14n#", transform.Algorithm);
            Assert.Equal(string.Empty, transform.InclusiveNamespacesPrefixList);
            CheckProperties(transform);

            transform = new UnprotectedXmlDsigExcC14NTransform("#default xsd");
            Assert.Equal("http://www.w3.org/2001/10/xml-exc-c14n#", transform.Algorithm);
            Assert.Equal("#default xsd", transform.InclusiveNamespacesPrefixList);
            CheckProperties(transform);
        }
Exemplo n.º 4
0
 public XmlDsigExcC14NTransformTest()
 {
     transform = new UnprotectedXmlDsigExcC14NTransform();
 }