Skip to content

Commit d16149a

Browse files
committed
Fix unit test
1 parent 2e5a86a commit d16149a

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

tests/ImageSharp.Tests/Processing/Transforms/SwizzleTests.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ public class SwizzleTests : BaseImageOperationsExtensionTest
1111
{
1212
private struct InvertXAndYSwizzler : ISwizzler
1313
{
14-
public Size DestinationSize => new Size(10, 10);
14+
public InvertXAndYSwizzler(Size sourceSize)
15+
{
16+
this.DestinationSize = new Size(sourceSize.Height, sourceSize.Width);
17+
}
18+
19+
public Size DestinationSize { get; }
1520

1621
public void Transform(Point point, out Point newPoint)
1722
=> newPoint = new Point(point.Y, point.X);
@@ -23,13 +28,13 @@ public void InvertXAndYSwizzlerSetsCorrectSizes()
2328
int width = 5;
2429
int height = 10;
2530

26-
this.operations.Swizzle(default(InvertXAndYSwizzler));
31+
this.operations.Swizzle(new InvertXAndYSwizzler(new Size(width, height)));
2732
SwizzleProcessor<InvertXAndYSwizzler> processor = this.Verify<SwizzleProcessor<InvertXAndYSwizzler>>();
2833

2934
Assert.Equal(processor.Swizzler.DestinationSize.Width, height);
3035
Assert.Equal(processor.Swizzler.DestinationSize.Height, width);
3136

32-
this.operations.Swizzle(default(InvertXAndYSwizzler));
37+
this.operations.Swizzle(new InvertXAndYSwizzler(processor.Swizzler.DestinationSize));
3338
SwizzleProcessor<InvertXAndYSwizzler> processor2 = this.Verify<SwizzleProcessor<InvertXAndYSwizzler>>(1);
3439

3540
Assert.Equal(processor2.Swizzler.DestinationSize.Width, width);

0 commit comments

Comments
 (0)