From dd051e2248bc67880981fa48194a90a08add5eff Mon Sep 17 00:00:00 2001 From: Brian Popow Date: Thu, 9 Dec 2021 20:03:05 +0100 Subject: [PATCH] Remove RunSerial from tests --- .../Formats/Bmp/BmpDecoderTests.cs | 1 - .../Formats/Bmp/BmpEncoderTests.cs | 7 +++---- .../Formats/GeneralFormatTests.cs | 8 +++----- .../Formats/Gif/GifDecoderTests.cs | 3 +-- .../Formats/Gif/GifEncoderTests.cs | 3 +-- .../Formats/Gif/GifMetadataTests.cs | 5 ++--- .../Formats/Jpg/JpegDecoderTests.cs | 3 +-- .../Formats/Jpg/JpegEncoderTests.cs | 13 ++++++------- .../Formats/Png/PngDecoderTests.cs | 3 +-- .../Formats/Png/PngEncoderTests.cs | 19 +++++++++---------- .../Formats/Tga/TgaDecoderTests.cs | 3 +-- .../Formats/Tga/TgaEncoderTests.cs | 5 ++--- .../Formats/Tiff/TiffDecoderTests.cs | 5 ++--- .../Formats/Tiff/TiffEncoderTests.cs | 1 - .../Formats/Tiff/TiffMetadataTests.cs | 3 +-- .../Formats/WebP/WebpDecoderTests.cs | 1 - .../Formats/WebP/WebpEncoderTests.cs | 1 - 17 files changed, 33 insertions(+), 51 deletions(-) diff --git a/tests/ImageSharp.Tests/Formats/Bmp/BmpDecoderTests.cs b/tests/ImageSharp.Tests/Formats/Bmp/BmpDecoderTests.cs index 4e6dc36dc..f85bc78fc 100644 --- a/tests/ImageSharp.Tests/Formats/Bmp/BmpDecoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Bmp/BmpDecoderTests.cs @@ -19,7 +19,6 @@ using static SixLabors.ImageSharp.Tests.TestImages.Bmp; // ReSharper disable InconsistentNaming namespace SixLabors.ImageSharp.Tests.Formats.Bmp { - [Collection("RunSerial")] [Trait("Format", "Bmp")] public class BmpDecoderTests { diff --git a/tests/ImageSharp.Tests/Formats/Bmp/BmpEncoderTests.cs b/tests/ImageSharp.Tests/Formats/Bmp/BmpEncoderTests.cs index d645f0b60..073cf5fcf 100644 --- a/tests/ImageSharp.Tests/Formats/Bmp/BmpEncoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Bmp/BmpEncoderTests.cs @@ -17,19 +17,18 @@ using static SixLabors.ImageSharp.Tests.TestImages.Bmp; // ReSharper disable InconsistentNaming namespace SixLabors.ImageSharp.Tests.Formats.Bmp { - [Collection("RunSerial")] [Trait("Format", "Bmp")] public class BmpEncoderTests { public static readonly TheoryData BitsPerPixel = - new TheoryData + new() { BmpBitsPerPixel.Pixel24, BmpBitsPerPixel.Pixel32 }; public static readonly TheoryData RatioFiles = - new TheoryData + new() { { Car, 3780, 3780, PixelResolutionUnit.PixelsPerMeter }, { V5Header, 3780, 3780, PixelResolutionUnit.PixelsPerMeter }, @@ -37,7 +36,7 @@ namespace SixLabors.ImageSharp.Tests.Formats.Bmp }; public static readonly TheoryData BmpBitsPerPixelFiles = - new TheoryData + new() { { Bit1, BmpBitsPerPixel.Pixel1 }, { Bit4, BmpBitsPerPixel.Pixel4 }, diff --git a/tests/ImageSharp.Tests/Formats/GeneralFormatTests.cs b/tests/ImageSharp.Tests/Formats/GeneralFormatTests.cs index 26eff2650..73c332f66 100644 --- a/tests/ImageSharp.Tests/Formats/GeneralFormatTests.cs +++ b/tests/ImageSharp.Tests/Formats/GeneralFormatTests.cs @@ -8,7 +8,6 @@ using System.Linq; using System.Reflection; using SixLabors.ImageSharp.Formats; using SixLabors.ImageSharp.Formats.Png; -using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; using SixLabors.ImageSharp.Processing.Processors.Quantization; @@ -16,7 +15,6 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Formats { - [Collection("RunSerial")] public class GeneralFormatTests { /// @@ -34,7 +32,7 @@ namespace SixLabors.ImageSharp.Tests.Formats /// /// The collection of image files to test against. /// - protected static readonly List Files = new List + protected static readonly List Files = new() { TestFile.Create(TestImages.Jpeg.Baseline.Calliphora), TestFile.Create(TestImages.Bmp.Car), @@ -85,8 +83,8 @@ namespace SixLabors.ImageSharp.Tests.Formats } public static readonly TheoryData QuantizerNames = - new TheoryData - { + new() + { nameof(KnownQuantizers.Octree), nameof(KnownQuantizers.WebSafe), nameof(KnownQuantizers.Werner), diff --git a/tests/ImageSharp.Tests/Formats/Gif/GifDecoderTests.cs b/tests/ImageSharp.Tests/Formats/Gif/GifDecoderTests.cs index 824ca535b..6bf606ac9 100644 --- a/tests/ImageSharp.Tests/Formats/Gif/GifDecoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Gif/GifDecoderTests.cs @@ -17,13 +17,12 @@ using Xunit; // ReSharper disable InconsistentNaming namespace SixLabors.ImageSharp.Tests.Formats.Gif { - [Collection("RunSerial")] [Trait("Format", "Gif")] public class GifDecoderTests { private const PixelTypes TestPixelTypes = PixelTypes.Rgba32 | PixelTypes.RgbaVector | PixelTypes.Argb32; - private static GifDecoder GifDecoder => new GifDecoder(); + private static GifDecoder GifDecoder => new(); public static readonly string[] MultiFrameTestFiles = { diff --git a/tests/ImageSharp.Tests/Formats/Gif/GifEncoderTests.cs b/tests/ImageSharp.Tests/Formats/Gif/GifEncoderTests.cs index 00d43b6ff..cb24de81b 100644 --- a/tests/ImageSharp.Tests/Formats/Gif/GifEncoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Gif/GifEncoderTests.cs @@ -13,7 +13,6 @@ using Xunit; // ReSharper disable InconsistentNaming namespace SixLabors.ImageSharp.Tests.Formats.Gif { - [Collection("RunSerial")] [Trait("Format", "Gif")] public class GifEncoderTests { @@ -21,7 +20,7 @@ namespace SixLabors.ImageSharp.Tests.Formats.Gif private static readonly ImageComparer ValidatorComparer = ImageComparer.TolerantPercentage(0.0015F); public static readonly TheoryData RatioFiles = - new TheoryData + new() { { TestImages.Gif.Rings, (int)ImageMetadata.DefaultHorizontalResolution, (int)ImageMetadata.DefaultVerticalResolution, PixelResolutionUnit.PixelsPerInch }, { TestImages.Gif.Ratio1x4, 1, 4, PixelResolutionUnit.AspectRatio }, diff --git a/tests/ImageSharp.Tests/Formats/Gif/GifMetadataTests.cs b/tests/ImageSharp.Tests/Formats/Gif/GifMetadataTests.cs index 59f7ebb74..5699b4741 100644 --- a/tests/ImageSharp.Tests/Formats/Gif/GifMetadataTests.cs +++ b/tests/ImageSharp.Tests/Formats/Gif/GifMetadataTests.cs @@ -12,12 +12,11 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Formats.Gif { - [Collection("RunSerial")] [Trait("Format", "Gif")] public class GifMetadataTests { public static readonly TheoryData RatioFiles = - new TheoryData + new() { { TestImages.Gif.Rings, (int)ImageMetadata.DefaultHorizontalResolution, (int)ImageMetadata.DefaultVerticalResolution, PixelResolutionUnit.PixelsPerInch }, { TestImages.Gif.Ratio1x4, 1, 4, PixelResolutionUnit.AspectRatio }, @@ -25,7 +24,7 @@ namespace SixLabors.ImageSharp.Tests.Formats.Gif }; public static readonly TheoryData RepeatFiles = - new TheoryData + new() { { TestImages.Gif.Cheers, 0 }, { TestImages.Gif.Receipt, 1 }, diff --git a/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs b/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs index dcdfc3e42..08d8d9038 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs @@ -21,8 +21,7 @@ using Xunit.Abstractions; namespace SixLabors.ImageSharp.Tests.Formats.Jpg { // TODO: Scatter test cases into multiple test classes - [Collection("RunSerial")] - [Trait("Format", "Jpg")] + [Trait("Format", "Jpg")] public partial class JpegDecoderTests { public const PixelTypes CommonNonDefaultPixelTypes = PixelTypes.Rgba32 | PixelTypes.Argb32 | PixelTypes.Bgr24 | PixelTypes.RgbaVector; diff --git a/tests/ImageSharp.Tests/Formats/Jpg/JpegEncoderTests.cs b/tests/ImageSharp.Tests/Formats/Jpg/JpegEncoderTests.cs index 62952f537..18eae9fbd 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/JpegEncoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/JpegEncoderTests.cs @@ -19,23 +19,22 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Formats.Jpg { - [Collection("RunSerial")] [Trait("Format", "Jpg")] public class JpegEncoderTests { - private static JpegEncoder JpegEncoder => new JpegEncoder(); + private static JpegEncoder JpegEncoder => new(); - private static JpegDecoder JpegDecoder => new JpegDecoder(); + private static JpegDecoder JpegDecoder => new(); public static readonly TheoryData QualityFiles = - new TheoryData + new() { { TestImages.Jpeg.Baseline.Calliphora, 80 }, { TestImages.Jpeg.Progressive.Fb, 75 } }; public static readonly TheoryData BitsPerPixel_Quality = - new TheoryData + new() { { JpegColorType.YCbCrRatio420, 40 }, { JpegColorType.YCbCrRatio420, 60 }, @@ -49,7 +48,7 @@ namespace SixLabors.ImageSharp.Tests.Formats.Jpg }; public static readonly TheoryData Grayscale_Quality = - new TheoryData + new() { { 40 }, { 60 }, @@ -57,7 +56,7 @@ namespace SixLabors.ImageSharp.Tests.Formats.Jpg }; public static readonly TheoryData RatioFiles = - new TheoryData + new() { { TestImages.Jpeg.Baseline.Ratio1x1, 1, 1, PixelResolutionUnit.AspectRatio }, { TestImages.Jpeg.Baseline.Snake, 300, 300, PixelResolutionUnit.PixelsPerInch }, diff --git a/tests/ImageSharp.Tests/Formats/Png/PngDecoderTests.cs b/tests/ImageSharp.Tests/Formats/Png/PngDecoderTests.cs index 9fc4d03dd..543a544d0 100644 --- a/tests/ImageSharp.Tests/Formats/Png/PngDecoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Png/PngDecoderTests.cs @@ -16,13 +16,12 @@ using Xunit; // ReSharper disable InconsistentNaming namespace SixLabors.ImageSharp.Tests.Formats.Png { - [Collection("RunSerial")] [Trait("Format", "Png")] public partial class PngDecoderTests { private const PixelTypes PixelTypes = Tests.PixelTypes.Rgba32 | Tests.PixelTypes.RgbaVector | Tests.PixelTypes.Argb32; - private static PngDecoder PngDecoder => new PngDecoder(); + private static PngDecoder PngDecoder => new(); public static readonly string[] CommonTestImages = { diff --git a/tests/ImageSharp.Tests/Formats/Png/PngEncoderTests.cs b/tests/ImageSharp.Tests/Formats/Png/PngEncoderTests.cs index 9e99dded8..3cc879d6b 100644 --- a/tests/ImageSharp.Tests/Formats/Png/PngEncoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Png/PngEncoderTests.cs @@ -15,21 +15,20 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Formats.Png { - [Collection("RunSerial")] [Trait("Format", "Png")] public partial class PngEncoderTests { - private static PngEncoder PngEncoder => new PngEncoder(); + private static PngEncoder PngEncoder => new(); public static readonly TheoryData PngBitDepthFiles = - new TheoryData + new() { { TestImages.Png.Rgb48Bpp, PngBitDepth.Bit16 }, { TestImages.Png.Bpp1, PngBitDepth.Bit1 } }; public static readonly TheoryData PngTrnsFiles = - new TheoryData + new() { { TestImages.Png.Gray1BitTrans, PngBitDepth.Bit1, PngColorType.Grayscale }, { TestImages.Png.Gray2BitTrans, PngBitDepth.Bit2, PngColorType.Grayscale }, @@ -43,7 +42,7 @@ namespace SixLabors.ImageSharp.Tests.Formats.Png /// /// All types except Palette /// - public static readonly TheoryData PngColorTypes = new TheoryData + public static readonly TheoryData PngColorTypes = new() { PngColorType.RgbWithAlpha, PngColorType.Rgb, @@ -51,7 +50,7 @@ namespace SixLabors.ImageSharp.Tests.Formats.Png PngColorType.GrayscaleWithAlpha, }; - public static readonly TheoryData PngFilterMethods = new TheoryData + public static readonly TheoryData PngFilterMethods = new() { PngFilterMethod.None, PngFilterMethod.Sub, @@ -65,7 +64,7 @@ namespace SixLabors.ImageSharp.Tests.Formats.Png /// All types except Palette /// public static readonly TheoryData CompressionLevels - = new TheoryData + = new() { PngCompressionLevel.Level0, PngCompressionLevel.Level1, @@ -79,12 +78,12 @@ namespace SixLabors.ImageSharp.Tests.Formats.Png PngCompressionLevel.Level9, }; - public static readonly TheoryData PaletteSizes = new TheoryData + public static readonly TheoryData PaletteSizes = new() { 30, 55, 100, 201, 255 }; - public static readonly TheoryData PaletteLargeOnly = new TheoryData + public static readonly TheoryData PaletteLargeOnly = new() { 80, 100, 120, 230 }; @@ -96,7 +95,7 @@ namespace SixLabors.ImageSharp.Tests.Formats.Png }; public static readonly TheoryData RatioFiles = - new TheoryData + new() { { TestImages.Png.Splash, 11810, 11810, PixelResolutionUnit.PixelsPerMeter }, { TestImages.Png.Ratio1x4, 1, 4, PixelResolutionUnit.AspectRatio }, diff --git a/tests/ImageSharp.Tests/Formats/Tga/TgaDecoderTests.cs b/tests/ImageSharp.Tests/Formats/Tga/TgaDecoderTests.cs index 1c53ff6a1..ffe7a048c 100644 --- a/tests/ImageSharp.Tests/Formats/Tga/TgaDecoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Tga/TgaDecoderTests.cs @@ -15,11 +15,10 @@ using static SixLabors.ImageSharp.Tests.TestImages.Tga; // ReSharper disable InconsistentNaming namespace SixLabors.ImageSharp.Tests.Formats.Tga { - [Collection("RunSerial")] [Trait("Format", "Tga")] public class TgaDecoderTests { - private static TgaDecoder TgaDecoder => new TgaDecoder(); + private static TgaDecoder TgaDecoder => new(); [Theory] [WithFile(Gray8BitTopLeft, PixelTypes.Rgba32)] diff --git a/tests/ImageSharp.Tests/Formats/Tga/TgaEncoderTests.cs b/tests/ImageSharp.Tests/Formats/Tga/TgaEncoderTests.cs index 4c768a1a5..642f53c0b 100644 --- a/tests/ImageSharp.Tests/Formats/Tga/TgaEncoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Tga/TgaEncoderTests.cs @@ -11,19 +11,18 @@ using static SixLabors.ImageSharp.Tests.TestImages.Tga; // ReSharper disable InconsistentNaming namespace SixLabors.ImageSharp.Tests.Formats.Tga { - [Collection("RunSerial")] [Trait("Format", "Tga")] public class TgaEncoderTests { public static readonly TheoryData BitsPerPixel = - new TheoryData + new() { TgaBitsPerPixel.Pixel24, TgaBitsPerPixel.Pixel32 }; public static readonly TheoryData TgaBitsPerPixelFiles = - new TheoryData + new() { { Gray8BitBottomLeft, TgaBitsPerPixel.Pixel8 }, { Bit16BottomLeft, TgaBitsPerPixel.Pixel16 }, diff --git a/tests/ImageSharp.Tests/Formats/Tiff/TiffDecoderTests.cs b/tests/ImageSharp.Tests/Formats/Tiff/TiffDecoderTests.cs index 4a13bbe62..b7bd5275d 100644 --- a/tests/ImageSharp.Tests/Formats/Tiff/TiffDecoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Tiff/TiffDecoderTests.cs @@ -15,15 +15,14 @@ using static SixLabors.ImageSharp.Tests.TestImages.Tiff; namespace SixLabors.ImageSharp.Tests.Formats.Tiff { - [Collection("RunSerial")] [Trait("Format", "Tiff")] public class TiffDecoderTests { public static readonly string[] MultiframeTestImages = Multiframes; - private static TiffDecoder TiffDecoder => new TiffDecoder(); + private static TiffDecoder TiffDecoder => new(); - private static MagickReferenceDecoder ReferenceDecoder => new MagickReferenceDecoder(); + private static MagickReferenceDecoder ReferenceDecoder => new(); [Theory] [WithFile(RgbUncompressedTiled, PixelTypes.Rgba32)] diff --git a/tests/ImageSharp.Tests/Formats/Tiff/TiffEncoderTests.cs b/tests/ImageSharp.Tests/Formats/Tiff/TiffEncoderTests.cs index d85ed16a7..aded52cd9 100644 --- a/tests/ImageSharp.Tests/Formats/Tiff/TiffEncoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Tiff/TiffEncoderTests.cs @@ -11,7 +11,6 @@ using static SixLabors.ImageSharp.Tests.TestImages.Tiff; namespace SixLabors.ImageSharp.Tests.Formats.Tiff { - [Collection("RunSerial")] [Trait("Format", "Tiff")] public class TiffEncoderTests : TiffEncoderBaseTester { diff --git a/tests/ImageSharp.Tests/Formats/Tiff/TiffMetadataTests.cs b/tests/ImageSharp.Tests/Formats/Tiff/TiffMetadataTests.cs index cdd9616a7..64c029b44 100644 --- a/tests/ImageSharp.Tests/Formats/Tiff/TiffMetadataTests.cs +++ b/tests/ImageSharp.Tests/Formats/Tiff/TiffMetadataTests.cs @@ -16,11 +16,10 @@ using static SixLabors.ImageSharp.Tests.TestImages.Tiff; namespace SixLabors.ImageSharp.Tests.Formats.Tiff { - [Collection("RunSerial")] [Trait("Format", "Tiff")] public class TiffMetadataTests { - private static TiffDecoder TiffDecoder => new TiffDecoder(); + private static TiffDecoder TiffDecoder => new(); [Fact] public void TiffMetadata_CloneIsDeep() diff --git a/tests/ImageSharp.Tests/Formats/WebP/WebpDecoderTests.cs b/tests/ImageSharp.Tests/Formats/WebP/WebpDecoderTests.cs index 2cbeff2ce..22342e612 100644 --- a/tests/ImageSharp.Tests/Formats/WebP/WebpDecoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/WebP/WebpDecoderTests.cs @@ -12,7 +12,6 @@ using static SixLabors.ImageSharp.Tests.TestImages.Webp; // ReSharper disable InconsistentNaming namespace SixLabors.ImageSharp.Tests.Formats.Webp { - [Collection("RunSerial")] [Trait("Format", "Webp")] public class WebpDecoderTests { diff --git a/tests/ImageSharp.Tests/Formats/WebP/WebpEncoderTests.cs b/tests/ImageSharp.Tests/Formats/WebP/WebpEncoderTests.cs index ec0040a46..607d4c764 100644 --- a/tests/ImageSharp.Tests/Formats/WebP/WebpEncoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/WebP/WebpEncoderTests.cs @@ -11,7 +11,6 @@ using static SixLabors.ImageSharp.Tests.TestImages.Webp; namespace SixLabors.ImageSharp.Tests.Formats.Webp { - [Collection("RunSerial")] [Trait("Format", "Webp")] public class WebpEncoderTests {