public void Test_FromXDocument() { using (IMagickImage image = new MagickImage(Files.InvitationTIF)) { XmpProfile profile = image.GetXmpProfile(); Assert.IsNotNull(profile); XDocument doc = profile.ToXDocument(); ExceptionAssert.Throws <ArgumentNullException>("document", () => { XmpProfile.FromXDocument(null); }); XmpProfile newProfile = XmpProfile.FromXDocument(doc); image.AddProfile(newProfile); doc = profile.ToXDocument(); TestXDocument(doc); profile = image.GetXmpProfile(); Assert.IsNotNull(profile); doc = profile.ToXDocument(); TestXDocument(doc); Assert.AreEqual(profile, newProfile); } }
public void Test_ToXDocument() { using (MagickImage image = new MagickImage(Files.InvitationTif)) { XmpProfile profile = image.GetXmpProfile(); Assert.IsNotNull(profile); XDocument document = profile.ToXDocument(); TestXDocument(document); } }