Example #1
0
        public void GetXml_FromLoadXml_CachesXml()
        {
            EncryptionMethod method = new EncryptionMethod();

            XmlDocument document = new XmlDocument();
            XmlElement  value    = document.CreateElement("EncryptionMethod");

            method.LoadXml(value);
            Assert.Same(method.GetXml(), method.GetXml());
        }
Example #2
0
        public void LoadXml(string xml, string expectedKeyAlgorithm, int expectedKeySize)
        {
            XmlDocument document = new XmlDocument();

            document.LoadXml(xml);
            XmlElement value = (XmlElement)document.FirstChild;

            EncryptionMethod method = new EncryptionMethod();

            method.LoadXml(value);

            Assert.Equal(expectedKeyAlgorithm, method.KeyAlgorithm);
            Assert.Equal(expectedKeySize, method.KeySize);

            Assert.Same(value, method.GetXml());
        }
Example #3
0
        public void GetXml_FromConstructor_DoesntCacheXml()
        {
            EncryptionMethod method = new EncryptionMethod();

            Assert.NotSame(method.GetXml(), method.GetXml());
        }
Example #4
0
        public void GetXml(EncryptionMethod method, string xml)
        {
            XmlElement element = method.GetXml();

            Assert.Equal(xml, element.OuterXml);
        }