Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JimBobSquarePants committed Jul 3, 2024
1 parent d27c03a commit ac5ace7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -252,23 +252,24 @@ public void Transform_With_Custom_Dimensions<TPixel>(TestImageProvider<TPixel> p
[Fact]
public void TransformRotationDoesNotOffset()
{
Rgba32 marker = Color.Aqua;
Rgba32 background = Color.DimGray.ToPixel<Rgba32>();
Rgba32 marker = Color.Aqua.ToPixel<Rgba32>();

using Image<Rgba32> img = new(100, 100, Color.DimGray);
using Image<Rgba32> img = new(100, 100, background);
img[0, 0] = marker;

img.Mutate(c => c.Rotate(180));

Assert.Equal(marker, img[99, 99]);

using Image<Rgba32> img2 = new(100, 100, Color.DimGray);
using Image<Rgba32> img2 = new(100, 100, background);
img2[0, 0] = marker;

img2.Mutate(
c =>
c.Transform(new AffineTransformBuilder().AppendRotationDegrees(180), KnownResamplers.NearestNeighbor));

using Image<Rgba32> img3 = new(100, 100, Color.DimGray);
using Image<Rgba32> img3 = new(100, 100, background);
img3[0, 0] = marker;

img3.Mutate(c => c.Transform(new AffineTransformBuilder().AppendRotationDegrees(180)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,23 +188,24 @@ public void Transform_With_Custom_Dimensions<TPixel>(TestImageProvider<TPixel> p
[Fact]
public void TransformRotationDoesNotOffset()
{
Rgba32 marker = Color.Aqua;
Rgba32 background = Color.DimGray.ToPixel<Rgba32>();
Rgba32 marker = Color.Aqua.ToPixel<Rgba32>();

using Image<Rgba32> img = new(100, 100, Color.DimGray);
using Image<Rgba32> img = new(100, 100, background);
img[0, 0] = marker;

img.Mutate(c => c.Rotate(180));

Assert.Equal(marker, img[99, 99]);

using Image<Rgba32> img2 = new(100, 100, Color.DimGray);
using Image<Rgba32> img2 = new(100, 100, background);
img2[0, 0] = marker;

img2.Mutate(
c =>
c.Transform(new ProjectiveTransformBuilder().AppendRotationDegrees(180), KnownResamplers.NearestNeighbor));

using Image<Rgba32> img3 = new(100, 100, Color.DimGray);
using Image<Rgba32> img3 = new(100, 100, background);
img3[0, 0] = marker;

img3.Mutate(c => c.Transform(new AffineTransformBuilder().AppendRotationDegrees(180)));
Expand Down

0 comments on commit ac5ace7

Please sign in to comment.