Skip to content

Commit

Permalink
Moved unit test to separate file.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlemstra committed Apr 6, 2022
1 parent c0219bd commit b26665d
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 19 deletions.
19 changes: 0 additions & 19 deletions tests/Magick.NET.Tests/MagickImageTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1919,25 +1919,6 @@ public void Test_Shave()
}
}

[Fact]
public void Test_Shear()
{
using (var image = new MagickImage(Files.TestPNG))
{
image.BackgroundColor = MagickColors.Firebrick;
image.VirtualPixelMethod = VirtualPixelMethod.Background;
image.Shear(20, 40);

Assert.Equal(186, image.Width);
Assert.Equal(195, image.Height);

ColorAssert.Equal(MagickColors.Red, image, 14, 68);
ColorAssert.Equal(MagickColors.Firebrick, image, 45, 6);
ColorAssert.Equal(MagickColors.Blue, image, 150, 171);
ColorAssert.Equal(MagickColors.Firebrick, image, 158, 181);
}
}

[Fact]
public void Test_Signature()
{
Expand Down
33 changes: 33 additions & 0 deletions tests/Magick.NET.Tests/MagickImageTests/TheShearMethod.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Copyright Dirk Lemstra https://github.com/dlemstra/Magick.NET.
// Licensed under the Apache License, Version 2.0.

using ImageMagick;
using Xunit;

namespace Magick.NET.Tests
{
public partial class MagickImageTests
{
public class TheShearMethod
{
[Fact]
public void ShouldShearTheImage()
{
using (var image = new MagickImage(Files.TestPNG))
{
image.BackgroundColor = MagickColors.Firebrick;
image.VirtualPixelMethod = VirtualPixelMethod.Background;
image.Shear(20, 40);

Assert.Equal(186, image.Width);
Assert.Equal(195, image.Height);

ColorAssert.Equal(MagickColors.Red, image, 14, 68);
ColorAssert.Equal(MagickColors.Firebrick, image, 45, 6);
ColorAssert.Equal(MagickColors.Blue, image, 150, 171);
ColorAssert.Equal(MagickColors.Firebrick, image, 158, 181);
}
}
}
}
}

0 comments on commit b26665d

Please sign in to comment.