public void CloneIsDeep() { var meta = new GifMetadata() { RepeatCount = 1, ColorTableMode = GifColorTableMode.Global, GlobalColorTableLength = 2 }; var clone = (GifMetadata)meta.DeepClone(); clone.RepeatCount = 2; clone.ColorTableMode = GifColorTableMode.Local; clone.GlobalColorTableLength = 1; Assert.False(meta.RepeatCount.Equals(clone.RepeatCount)); Assert.False(meta.ColorTableMode.Equals(clone.ColorTableMode)); Assert.False(meta.GlobalColorTableLength.Equals(clone.GlobalColorTableLength)); }
public void CloneIsDeep() { var meta = new GifMetadata { RepeatCount = 1, ColorTableMode = GifColorTableMode.Global, GlobalColorTableLength = 2, Comments = new List <string> { "Foo" } }; var clone = (GifMetadata)meta.DeepClone(); clone.RepeatCount = 2; clone.ColorTableMode = GifColorTableMode.Local; clone.GlobalColorTableLength = 1; Assert.False(meta.RepeatCount.Equals(clone.RepeatCount)); Assert.False(meta.ColorTableMode.Equals(clone.ColorTableMode)); Assert.False(meta.GlobalColorTableLength.Equals(clone.GlobalColorTableLength)); Assert.False(meta.Comments.Equals(clone.Comments)); Assert.True(meta.Comments.SequenceEqual(clone.Comments)); }