public void CloneIsDeep() { var metaData = new ImageMetadata { ExifProfile = new ExifProfile(), HorizontalResolution = 4, VerticalResolution = 2 }; ImageMetadata clone = metaData.DeepClone(); clone.HorizontalResolution = 2; clone.VerticalResolution = 4; Assert.False(metaData.ExifProfile.Equals(clone.ExifProfile)); Assert.False(metaData.HorizontalResolution.Equals(clone.HorizontalResolution)); Assert.False(metaData.VerticalResolution.Equals(clone.VerticalResolution)); }
public void ConstructorImageMetaData() { var metaData = new ImageMetadata(); var exifProfile = new ExifProfile(); var imageProperty = new ImageProperty("name", "value"); metaData.ExifProfile = exifProfile; metaData.HorizontalResolution = 4; metaData.VerticalResolution = 2; metaData.Properties.Add(imageProperty); ImageMetadata clone = metaData.DeepClone(); Assert.Equal(exifProfile.ToByteArray(), clone.ExifProfile.ToByteArray()); Assert.Equal(4, clone.HorizontalResolution); Assert.Equal(2, clone.VerticalResolution); Assert.Equal(imageProperty, clone.Properties[0]); }
public void CloneIsDeep() { var metaData = new ImageMetadata(); var exifProfile = new ExifProfile(); var imageProperty = new ImageProperty("name", "value"); metaData.ExifProfile = exifProfile; metaData.HorizontalResolution = 4; metaData.VerticalResolution = 2; metaData.Properties.Add(imageProperty); ImageMetadata clone = metaData.DeepClone(); clone.HorizontalResolution = 2; clone.VerticalResolution = 4; Assert.False(metaData.ExifProfile.Equals(clone.ExifProfile)); Assert.False(metaData.HorizontalResolution.Equals(clone.HorizontalResolution)); Assert.False(metaData.VerticalResolution.Equals(clone.VerticalResolution)); Assert.False(metaData.Properties.Equals(clone.Properties)); Assert.False(metaData.GetFormatMetadata(GifFormat.Instance).Equals(clone.GetFormatMetadata(GifFormat.Instance))); }