From 7e89cf2ddf96fe69783b1739e3b669ab9ce1379d Mon Sep 17 00:00:00 2001 From: Stefan Nikolei Date: Thu, 28 May 2026 14:23:09 +0200 Subject: [PATCH] Remove cast to object --- .../PixelOperations/PixelOperationsTests.cs | 34 +++++++++++++++++++ .../Tests/TestImageProviderTests.cs | 24 +++++++------ 2 files changed, 48 insertions(+), 10 deletions(-) diff --git a/tests/ImageSharp.Tests/PixelFormats/PixelOperations/PixelOperationsTests.cs b/tests/ImageSharp.Tests/PixelFormats/PixelOperations/PixelOperationsTests.cs index b701d4d0ac..ba8dbceb01 100644 --- a/tests/ImageSharp.Tests/PixelFormats/PixelOperations/PixelOperationsTests.cs +++ b/tests/ImageSharp.Tests/PixelFormats/PixelOperations/PixelOperationsTests.cs @@ -344,6 +344,40 @@ public abstract class PixelOperationsTests : MeasureFixture (object)new TestPixel(), (object)new TestPixel(), }; + public static readonly TheoryData Generic_To_Data = new( + new object[] + { + new TestPixel(), + new TestPixel(), + new TestPixel(), + new TestPixel(), + new TestPixel(), + new TestPixel(), + new TestPixel(), + new TestPixel(), + new TestPixel(), + new TestPixel(), + new TestPixel(), + new TestPixel(), + new TestPixel(), + new TestPixel(), + new TestPixel(), + new TestPixel(), + new TestPixel(), + new TestPixel(), + new TestPixel(), + new TestPixel(), + new TestPixel(), + new TestPixel(), + new TestPixel(), + new TestPixel(), + new TestPixel(), + new TestPixel(), + new TestPixel(), + new TestPixel(), + new TestPixel(), + } + ); [Theory] [MemberData(nameof(Generic_To_Data))] diff --git a/tests/ImageSharp.Tests/TestUtilities/Tests/TestImageProviderTests.cs b/tests/ImageSharp.Tests/TestUtilities/Tests/TestImageProviderTests.cs index f886a814ef..4353920e26 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Tests/TestImageProviderTests.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Tests/TestImageProviderTests.cs @@ -14,17 +14,21 @@ namespace SixLabors.ImageSharp.Tests; public class TestImageProviderTests { - public static readonly TheoryData BasicData = new() - { - (object)TestImageProvider.Blank(10, 20), - (object)TestImageProvider.Blank(10, 20), - }; + public static readonly TheoryData BasicData = new( + new object[] + { + TestImageProvider.Blank(10, 20), + TestImageProvider.Blank(10, 20), + } + ); - public static readonly TheoryData FileData = new() - { - (object)TestImageProvider.File(TestImages.Bmp.Car), - (object)TestImageProvider.File(TestImages.Bmp.F) - }; + public static readonly TheoryData FileData = new( + new object[] + { + TestImageProvider.File(TestImages.Bmp.Car), + TestImageProvider.File(TestImages.Bmp.F), + } + ); public static string[] AllBmpFiles = [TestImages.Bmp.F, TestImages.Bmp.Bit8];