From e9738f21eb964fb7a1d0db23c2a3f6c8336dd18d Mon Sep 17 00:00:00 2001 From: Evangelink Date: Tue, 24 Nov 2020 15:38:55 +0100 Subject: [PATCH] Fix unit test --- .../Processing/Transforms/SwizzleTests.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/ImageSharp.Tests/Processing/Transforms/SwizzleTests.cs b/tests/ImageSharp.Tests/Processing/Transforms/SwizzleTests.cs index c54bfa25e..9c2701ae7 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/SwizzleTests.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/SwizzleTests.cs @@ -11,7 +11,12 @@ namespace SixLabors.ImageSharp.Tests.Processing.Transforms { private struct InvertXAndYSwizzler : ISwizzler { - public Size DestinationSize => new Size(10, 10); + public InvertXAndYSwizzler(Size sourceSize) + { + this.DestinationSize = new Size(sourceSize.Height, sourceSize.Width); + } + + public Size DestinationSize { get; } public void Transform(Point point, out Point newPoint) => newPoint = new Point(point.Y, point.X); @@ -23,13 +28,13 @@ namespace SixLabors.ImageSharp.Tests.Processing.Transforms int width = 5; int height = 10; - this.operations.Swizzle(default(InvertXAndYSwizzler)); + this.operations.Swizzle(new InvertXAndYSwizzler(new Size(width, height))); SwizzleProcessor processor = this.Verify>(); Assert.Equal(processor.Swizzler.DestinationSize.Width, height); Assert.Equal(processor.Swizzler.DestinationSize.Height, width); - this.operations.Swizzle(default(InvertXAndYSwizzler)); + this.operations.Swizzle(new InvertXAndYSwizzler(processor.Swizzler.DestinationSize)); SwizzleProcessor processor2 = this.Verify>(1); Assert.Equal(processor2.Swizzler.DestinationSize.Width, width);