public void ClipboardRoundTripWorks_Bmp() { var imagePath = GetPathToImage("PasteHS.bmp"); using (var image = PalasoImage.FromFileRobustly(imagePath)) { PortableClipboard.CopyImageToClipboard(image); using (var resultingImage = PortableClipboard.GetImageFromClipboard()) { // There is no working PalasoImage.Equals(), so just try a few properties Assert.AreEqual(image.FileName, resultingImage.FileName); Assert.AreEqual(image.Image.Size, resultingImage.Image.Size); Assert.AreEqual(image.Image.Flags, resultingImage.Image.Flags); } } }
public void ClipboardRoundTripWorks_GetsExistingMetadata() { var imagePath = GetPathToImage("AOR_EAG00864.png"); using (var image = PalasoImage.FromFileRobustly(imagePath)) { var preCopyLicense = image.Metadata.License.Token; var preCopyCollectionUri = image.Metadata.CollectionUri; PortableClipboard.CopyImageToClipboard(image); using (var resultingImage = PortableClipboard.GetImageFromClipboard()) { // Test that the same metadata came through Assert.IsTrue(resultingImage.Metadata.IsMinimallyComplete); Assert.AreEqual(preCopyLicense, resultingImage.Metadata.License.Token); Assert.AreEqual(preCopyCollectionUri, resultingImage.Metadata.CollectionUri); Assert.AreEqual(image.Image.Flags, resultingImage.Image.Flags); } } }