public void LoadXml_InvalidXml() { string xml = "<a />"; XmlDocument doc = new XmlDocument(); doc.LoadXml(xml); EncryptionProperty encryptionProperty = new EncryptionProperty(); Assert.Throws <CryptographicException>(() => encryptionProperty.LoadXml(doc.DocumentElement)); }
public void LoadXml_ValidEncryptionPropertyXml() { XmlDocument doc = new XmlDocument(); doc.LoadXml(ValidXml); EncryptionProperty encryptionProperty = new EncryptionProperty(); encryptionProperty.LoadXml(doc.DocumentElement); Assert.Equal(doc.DocumentElement, encryptionProperty.PropertyElement); Assert.Equal(IDValue, encryptionProperty.Id); Assert.Equal(TargetValue, encryptionProperty.Target); }
public void GetXml_Cached() { XmlDocument doc = new XmlDocument(); doc.LoadXml(ValidXml); EncryptionProperty encryptionProperty = new EncryptionProperty(); encryptionProperty.LoadXml(doc.DocumentElement); XmlElement output = encryptionProperty.GetXml(); Assert.Equal(ValidXml, output.OuterXml); }
public void LoadXml_Null() { EncryptionProperty encryptionProperty = new EncryptionProperty(); Assert.Throws <ArgumentNullException>(() => encryptionProperty.LoadXml(null)); }