示例#1
0
        public void LoadXml_NoValueOrReference()
        {
            XmlDocument xmlDocument = new XmlDocument();

            xmlDocument.LoadXml("<root/>");

            CipherData cipherData = new CipherData();

            Assert.Throws <CryptographicException>(() => cipherData.LoadXml(xmlDocument.DocumentElement));
        }
示例#2
0
        public void LoadXml_CipherReference(XmlElement xmlElement, string uri)
        {
            CipherData cipherData = new CipherData();

            cipherData.LoadXml(xmlElement);

            Assert.Equal(uri, cipherData.CipherReference.Uri);
            Assert.Null(cipherData.CipherValue);

            XmlElement gotXmlElement = cipherData.GetXml();

            Assert.NotNull(gotXmlElement);
            Assert.Equal(xmlElement.OuterXml, gotXmlElement.OuterXml);
        }
示例#3
0
        public void LoadXml_Null()
        {
            CipherData cipherData = new CipherData();

            Assert.Throws <ArgumentNullException>(() => cipherData.LoadXml(null));
        }