mirror of https://github.com/SixLabors/ImageSharp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.1 KiB
35 lines
1.1 KiB
// Copyright (c) Six Labors.
|
|
// Licensed under the Six Labors Split License.
|
|
|
|
using SixLabors.ImageSharp.Formats.Png;
|
|
|
|
namespace SixLabors.ImageSharp.Tests.Formats.Png;
|
|
|
|
[Trait("Format", "Png")]
|
|
public class PngFrameMetadataTests
|
|
{
|
|
[Fact]
|
|
public void CloneIsDeep()
|
|
{
|
|
PngFrameMetadata meta = new()
|
|
{
|
|
FrameDelay = new(1, 0),
|
|
DisposalMethod = PngDisposalMethod.RestoreToBackground,
|
|
BlendMethod = PngBlendMethod.Over,
|
|
};
|
|
|
|
PngFrameMetadata clone = (PngFrameMetadata)meta.DeepClone();
|
|
|
|
Assert.True(meta.FrameDelay.Equals(clone.FrameDelay));
|
|
Assert.True(meta.DisposalMethod.Equals(clone.DisposalMethod));
|
|
Assert.True(meta.BlendMethod.Equals(clone.BlendMethod));
|
|
|
|
clone.FrameDelay = new(2, 1);
|
|
clone.DisposalMethod = PngDisposalMethod.RestoreToPrevious;
|
|
clone.BlendMethod = PngBlendMethod.Source;
|
|
|
|
Assert.False(meta.FrameDelay.Equals(clone.FrameDelay));
|
|
Assert.False(meta.DisposalMethod.Equals(clone.DisposalMethod));
|
|
Assert.False(meta.BlendMethod.Equals(clone.BlendMethod));
|
|
}
|
|
}
|
|
|