|
10 | 10 |
|
11 | 11 | namespace SixLabors.ImageSharp.Drawing.Tests.Issues
|
12 | 12 | {
|
13 |
| - public class Issue_28 |
| 13 | + public class Issue_28_108 |
14 | 14 | {
|
15 | 15 | private Rgba32 red = Color.Red.ToRgba32();
|
16 | 16 |
|
17 |
| - [Fact] |
18 |
| - public void DrawingLineAtTopShouldDisplay() |
| 17 | + [Theory] |
| 18 | + [InlineData(1F)] |
| 19 | + [InlineData(1.5F)] |
| 20 | + [InlineData(2F)] |
| 21 | + [InlineData(3F)] |
| 22 | + public void DrawingLineAtTopShouldDisplay(float stroke) |
19 | 23 | {
|
20 | 24 | using var image = new Image<Rgba32>(Configuration.Default, 100, 100, Color.Black);
|
21 | 25 | image.Mutate(x => x
|
22 | 26 | .SetGraphicsOptions(g => g.Antialias = false)
|
23 | 27 | .DrawLines(
|
24 | 28 | this.red,
|
25 |
| - 1f, |
| 29 | + stroke, |
26 | 30 | new PointF(0, 0),
|
27 | 31 | new PointF(100, 0)));
|
28 | 32 |
|
29 | 33 | IEnumerable<(int x, int y)> locations = Enumerable.Range(0, 100).Select(i => (x: i, y: 0));
|
30 | 34 | Assert.All(locations, l => Assert.Equal(this.red, image[l.x, l.y]));
|
31 | 35 | }
|
32 | 36 |
|
33 |
| - [Fact] |
34 |
| - public void DrawingLineAtBottomShouldDisplay() |
| 37 | + [Theory] |
| 38 | + [InlineData(1F)] |
| 39 | + [InlineData(1.5F)] |
| 40 | + [InlineData(2F)] |
| 41 | + [InlineData(3F)] |
| 42 | + public void DrawingLineAtBottomShouldDisplay(float stroke) |
35 | 43 | {
|
36 | 44 | using var image = new Image<Rgba32>(Configuration.Default, 100, 100, Color.Black);
|
37 | 45 | image.Mutate(x => x
|
38 | 46 | .SetGraphicsOptions(g => g.Antialias = false)
|
39 | 47 | .DrawLines(
|
40 | 48 | this.red,
|
41 |
| - 1f, |
| 49 | + stroke, |
42 | 50 | new PointF(0, 99),
|
43 | 51 | new PointF(100, 99)));
|
44 | 52 |
|
45 | 53 | IEnumerable<(int x, int y)> locations = Enumerable.Range(0, 100).Select(i => (x: i, y: 99));
|
46 | 54 | Assert.All(locations, l => Assert.Equal(this.red, image[l.x, l.y]));
|
47 | 55 | }
|
48 | 56 |
|
49 |
| - [Fact] |
50 |
| - public void DrawingLineAtLeftShouldDisplay() |
| 57 | + [Theory] |
| 58 | + [InlineData(1F)] |
| 59 | + [InlineData(1.5F)] |
| 60 | + [InlineData(2F)] |
| 61 | + [InlineData(3F)] |
| 62 | + public void DrawingLineAtLeftShouldDisplay(float stroke) |
51 | 63 | {
|
52 | 64 | using var image = new Image<Rgba32>(Configuration.Default, 100, 100, Color.Black);
|
53 | 65 | image.Mutate(x => x
|
54 | 66 | .SetGraphicsOptions(g => g.Antialias = false)
|
55 | 67 | .DrawLines(
|
56 | 68 | this.red,
|
57 |
| - 1f, |
| 69 | + stroke, |
58 | 70 | new PointF(0, 0),
|
59 | 71 | new PointF(0, 99)));
|
60 | 72 |
|
61 | 73 | IEnumerable<(int x, int y)> locations = Enumerable.Range(0, 100).Select(i => (x: 0, y: i));
|
62 | 74 | Assert.All(locations, l => Assert.Equal(this.red, image[l.x, l.y]));
|
63 | 75 | }
|
64 | 76 |
|
65 |
| - [Fact] |
66 |
| - public void DrawingLineAtRightShouldDisplay() |
| 77 | + [Theory] |
| 78 | + [InlineData(1F)] |
| 79 | + [InlineData(1.5F)] |
| 80 | + [InlineData(2F)] |
| 81 | + [InlineData(3F)] |
| 82 | + public void DrawingLineAtRightShouldDisplay(float stroke) |
67 | 83 | {
|
68 | 84 | using var image = new Image<Rgba32>(Configuration.Default, 100, 100, Color.Black);
|
69 | 85 | image.Mutate(x => x
|
70 | 86 | .SetGraphicsOptions(g => g.Antialias = false)
|
71 | 87 | .DrawLines(
|
72 | 88 | this.red,
|
73 |
| - 1f, |
| 89 | + stroke, |
74 | 90 | new PointF(99, 0),
|
75 | 91 | new PointF(99, 99)));
|
76 | 92 |
|
77 | 93 | IEnumerable<(int x, int y)> locations = Enumerable.Range(0, 100).Select(i => (x: 99, y: i));
|
78 |
| - |
79 | 94 | Assert.All(locations, l => Assert.Equal(this.red, image[l.x, l.y]));
|
80 | 95 | }
|
81 | 96 | }
|
|
0 commit comments