// Copyright (c) Six Labors. // Licensed under the Six Labors Split License. using SixLabors.ImageSharp.Formats.Bmp; using SixLabors.ImageSharp.Formats.Cur; using SixLabors.ImageSharp.Formats.Icon; using SixLabors.ImageSharp.PixelFormats; using static SixLabors.ImageSharp.Tests.TestImages.Cur; namespace SixLabors.ImageSharp.Tests.Formats.Icon.Cur; [Trait("Format", "Cur")] [ValidateDisposedMemoryAllocations] public class CurDecoderTests { [Theory] [WithFile(WindowsMouse, PixelTypes.Rgba32)] public void CurDecoder_Decode(TestImageProvider provider) { using Image image = provider.GetImage(CurDecoder.Instance); CurFrameMetadata meta = image.Frames[0].Metadata.GetCurMetadata(); Assert.Equal(image.Width, meta.EncodingWidth.Value); Assert.Equal(image.Height, meta.EncodingHeight.Value); Assert.Equal(IconFrameCompression.Bmp, meta.Compression); Assert.Equal(BmpBitsPerPixel.Bit32, meta.BmpBitsPerPixel); } [Theory] [WithFile(CurFake, PixelTypes.Rgba32)] [WithFile(CurReal, PixelTypes.Rgba32)] public void CurDecoder_Decode2(TestImageProvider provider) { using Image image = provider.GetImage(CurDecoder.Instance); CurFrameMetadata meta = image.Frames[0].Metadata.GetCurMetadata(); Assert.Equal(image.Width, meta.EncodingWidth.Value); Assert.Equal(image.Height, meta.EncodingHeight.Value); Assert.Equal(IconFrameCompression.Bmp, meta.Compression); Assert.Equal(BmpBitsPerPixel.Bit32, meta.BmpBitsPerPixel); } }