예제 #1
0
        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));
        }
예제 #2
0
        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));
        }