Skip to content

Commit 6a5c4fa

Browse files
committed
SixLabors#542: remove redundant Asserts, cleanup code
1 parent a5e2713 commit 6a5c4fa

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

tests/ImageSharp.Tests/Drawing/FillLinearGradientBrushTests.cs

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -63,29 +63,6 @@ public void HorizontalReturnsUnicolorColumns<TPixel>(
6363

6464
image.Mutate(x => x.Fill(unicolorLinearGradientBrush));
6565
image.DebugSave(provider);
66-
67-
using (PixelAccessor<TPixel> sourcePixels = image.Lock())
68-
{
69-
TPixel columnColor0 = sourcePixels[0, 0];
70-
TPixel columnColor23 = sourcePixels[23, 0];
71-
TPixel columnColor42 = sourcePixels[42, 0];
72-
TPixel columnColor333 = sourcePixels[333, 0];
73-
74-
TPixel lastColumnColor = sourcePixels[lastColumnIndex, 0];
75-
76-
for (int i = 0; i < image.Height; i++)
77-
{
78-
// check first and last column:
79-
Assert.Equal(columnColor0, sourcePixels[0, i]);
80-
Assert.Equal(lastColumnColor, sourcePixels[lastColumnIndex, i]);
81-
82-
// check the random colors:
83-
Assert.True(columnColor23.Equals(sourcePixels[23, i]), $"at {i}");
84-
Assert.Equal(columnColor42, sourcePixels[42, i]);
85-
Assert.Equal(columnColor333, sourcePixels[333, i]);
86-
}
87-
}
88-
8966
image.CompareToReferenceOutput(provider);
9067
}
9168
}
@@ -102,8 +79,6 @@ public void HorizontalGradientWithRepMode<TPixel>(
10279
{
10380
using (var image = provider.GetImage())
10481
{
105-
int lastColumnIndex = image.Width - 1;
106-
10782
TPixel red = NamedColors<TPixel>.Red;
10883
TPixel yellow = NamedColors<TPixel>.Yellow;
10984

@@ -302,7 +277,6 @@ public void DiagonalReturnsCorrectImages<TPixel>(
302277
[WithBlankImages(500, 500, PixelTypes.Rgba32, 0, 499, 499, 0, new[] { 0f, 0.2f, 0.5f, 0.9f }, new[] { 0, 1, 2, 3 })]
303278
[WithBlankImages(500, 500, PixelTypes.Rgba32, 499, 499, 0, 0, new[] { 0f, 0.7f, 0.8f, 0.9f}, new[] { 0, 1, 2, 0 })]
304279
[WithBlankImages(500, 500, PixelTypes.Rgba32, 0, 0, 499, 499, new[] { 0f, .5f, 1f}, new[]{0, 1, 3})]
305-
// TODO: add some more tests with arbitrary gradient orders!
306280
public void ArbitraryGradients<TPixel>(
307281
TestImageProvider<TPixel> provider,
308282
int startX, int startY,

0 commit comments

Comments
 (0)