Skip to content

Commit a29ecc2

Browse files
committed
add more tests
1 parent 29b2be9 commit a29ecc2

3 files changed

Lines changed: 22 additions & 0 deletions

File tree

tests/ImageSharp.Drawing.Tests/Drawing/FillPolygonTests.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,28 @@ public void FillPolygon_Solid_Transformed<TPixel>(TestImageProvider<TPixel> prov
8282
.FillPolygon(Color.White, simplePath));
8383
}
8484

85+
[Theory]
86+
[WithBasicTestPatternImages(100, 100, PixelTypes.Rgba32)]
87+
public void Fill_RectangularPolygon_Solid_Transformed<TPixel>(TestImageProvider<TPixel> provider)
88+
where TPixel : unmanaged, IPixel<TPixel>
89+
{
90+
var polygon = new RectangularPolygon(25, 25, 50, 50);
91+
92+
provider.RunValidatingProcessorTest(
93+
c => c.SetDrawingTransform(Matrix3x2.CreateRotation((float)Math.PI / 4, new PointF(50, 50)))
94+
.Fill(Color.White, polygon));
95+
}
96+
97+
[Theory]
98+
[WithBasicTestPatternImages(100, 100, PixelTypes.Rgba32)]
99+
public void Fill_RectangularPolygon_Solid_TransformedUsingConfiguration<TPixel>(TestImageProvider<TPixel> provider)
100+
where TPixel : unmanaged, IPixel<TPixel>
101+
{
102+
var polygon = new RectangularPolygon(25, 25, 50, 50);
103+
provider.Configuration.SetDrawingTransform(Matrix3x2.CreateRotation((float)Math.PI / 4, new PointF(50, 50)));
104+
provider.RunValidatingProcessorTest(c => c.Fill(Color.White, polygon));
105+
}
106+
85107
public static TheoryData<bool, IntersectionRule> FillPolygon_Complex_Data { get; } =
86108
new TheoryData<bool, IntersectionRule>()
87109
{
Loading
976 Bytes
Loading

0 commit comments

Comments
 (0)