24 writes to Colors
System.Drawing.Common.Tests (24)
System\Drawing\Drawing2D\ColorBlendTests.cs (2)
41
ColorBlend blend = new() {
Colors
= null };
44
blend.
Colors
= new Color[10];
System\Drawing\Drawing2D\LinearGradientBrushTests.cs (13)
261
Colors
= [Color.Red, Color.PeachPuff, Color.PowderBlue],
378
Colors
= [Color.Red, Color.PeachPuff, Color.PowderBlue],
394
Colors
= [Color.Wheat, Color.Yellow],
400
Colors
= [Color.Red, Color.PeachPuff, Color.PowderBlue],
419
Assert.Throws<NullReferenceException>(() => brush.InterpolationColors = new ColorBlend {
Colors
= null });
430
() => brush.InterpolationColors = new ColorBlend {
Colors
= new Color[colorsLength] });
437
Assert.Throws<ArgumentException>(() => brush.InterpolationColors = new ColorBlend {
Colors
= new Color[2], Positions = null });
449
Colors
= new Color[2],
462
Colors
= new Color[positions.Length],
474
Colors
= [Color.Red, Color.PeachPuff, Color.PowderBlue],
483
Colors
= new Color[2],
495
Colors
= [Color.Red, Color.PeachPuff, Color.PowderBlue],
514
Colors
= [Color.Red, Color.PeachPuff, Color.PowderBlue],
System\Drawing\Drawing2D\PathGradientBrushTests.cs (9)
533
brush.InterpolationColors = new ColorBlend() {
Colors
= expectedColors, Positions = expectedPositions };
537
brush.InterpolationColors = new ColorBlend() {
Colors
= sameColors, Positions = expectedPositions };
551
brush.InterpolationColors.
Colors
= colors;
583
brush.InterpolationColors = new ColorBlend() {
Colors
= null, Positions = null });
586
brush.InterpolationColors = new ColorBlend() {
Colors
= null, Positions = new float[2] });
594
brush.InterpolationColors = new ColorBlend() {
Colors
= new Color[1], Positions = null });
609
brush.InterpolationColors = new ColorBlend() {
Colors
= [], Positions = [] });
617
brush.InterpolationColors = new ColorBlend() {
Colors
= new Color[1], Positions = new float[2] });
625
brush.InterpolationColors = new ColorBlend() {
Colors
= new Color[2], Positions = new float[1] });
21 references to Colors
System.Drawing.Common.Tests (21)
System\Drawing\Drawing2D\ColorBlendTests.cs (4)
12
Assert.Equal(new Color[1], blend.
Colors
);
22
Assert.Equal(new Color[count], blend.
Colors
);
42
Assert.Null(blend.
Colors
);
45
Assert.Equal(new Color[10], blend.
Colors
);
System\Drawing\Drawing2D\LinearGradientBrushTests.cs (8)
383
Assert.Equal(blend.
Colors
.Select(c => Color.FromArgb(c.ToArgb())), brush.InterpolationColors.
Colors
);
404
Assert.Equal(blend.
Colors
.Select(c => Color.FromArgb(c.ToArgb())), brush.InterpolationColors.
Colors
);
502
brush.InterpolationColors.
Colors
.Should().HaveCount(1);
504
brush.InterpolationColors.
Colors
[0].IsEmpty.Should().BeTrue();
526
brush.InterpolationColors.
Colors
.Should().HaveCount(1);
528
brush.InterpolationColors.
Colors
[0].IsEmpty.Should().BeTrue();
System\Drawing\Drawing2D\PathGradientBrushTests.cs (9)
534
Assert.Equal(expectedColors, brush.InterpolationColors.
Colors
);
538
Assert.Equal(sameColors, brush.InterpolationColors.
Colors
);
549
brush.InterpolationColors.
Colors
.ToList().AddRange(colors);
550
Assert.Equal(defaultColors, brush.InterpolationColors.
Colors
);
552
Assert.Equal(defaultColors, brush.InterpolationColors.
Colors
);
553
brush.InterpolationColors.
Colors
[0] = Color.Pink;
554
Assert.NotEqual(Color.Pink, brush.InterpolationColors.
Colors
[0]);
555
Assert.Equal(defaultColors, brush.InterpolationColors.
Colors
);
946
Assert.Equal(new Color[] { Color.Empty }, brush.InterpolationColors.
Colors
);