public void LoadXml_NoValueOrReference() { XmlDocument xmlDocument = new XmlDocument(); xmlDocument.LoadXml("<root/>"); CipherData cipherData = new CipherData(); Assert.Throws <CryptographicException>(() => cipherData.LoadXml(xmlDocument.DocumentElement)); }
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); }
public void LoadXml_Null() { CipherData cipherData = new CipherData(); Assert.Throws <ArgumentNullException>(() => cipherData.LoadXml(null)); }