📷 A modern, cross-platform, 2D Graphics library for .NET
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.
 
 

52 lines
1.6 KiB

// Copyright (c) Six Labors.
// Licensed under the Six Labors Split License.
using SixLabors.ImageSharp.Metadata;
using SixLabors.ImageSharp.PixelFormats;
namespace SixLabors.ImageSharp.Tests;
public class ImageInfoTests
{
[Fact]
public void ImageInfoInitializesCorrectly()
{
const int width = 50;
const int height = 60;
Size size = new(width, height);
Rectangle rectangle = new(0, 0, width, height);
PixelTypeInfo pixelType = new(8);
ImageMetadata meta = new();
ImageInfo info = new(pixelType, size, meta);
Assert.Equal(pixelType, info.PixelType);
Assert.Equal(width, info.Width);
Assert.Equal(height, info.Height);
Assert.Equal(size, info.Size);
Assert.Equal(rectangle, info.Bounds);
Assert.Equal(meta, info.Metadata);
}
[Fact]
public void ImageInfoInitializesCorrectlyWithFrameMetadata()
{
const int width = 50;
const int height = 60;
Size size = new(width, height);
Rectangle rectangle = new(0, 0, width, height);
PixelTypeInfo pixelType = new(8);
ImageMetadata meta = new();
IReadOnlyList<ImageFrameMetadata> frameMetadata = new List<ImageFrameMetadata>() { new() };
ImageInfo info = new(pixelType, size, meta, frameMetadata);
Assert.Equal(pixelType, info.PixelType);
Assert.Equal(width, info.Width);
Assert.Equal(height, info.Height);
Assert.Equal(size, info.Size);
Assert.Equal(rectangle, info.Bounds);
Assert.Equal(meta, info.Metadata);
Assert.Equal(frameMetadata.Count, info.FrameMetadataCollection.Count);
}
}