20 writes to Positions
System.Drawing.Common.Tests (20)
System\Drawing\Drawing2D\BlendTests.cs (2)
51Blend blend = new() { Positions = null }; 54blend.Positions = new float[10];
System\Drawing\Drawing2D\LinearGradientBrushTests.cs (6)
284Positions = positions 303Positions = positions 326AssertExtensions.Throws<ArgumentException, ArgumentNullException>("value", "source", () => brush.Blend = new Blend { Factors = new float[2], Positions = null }); 333AssertExtensions.Throws<ArgumentException>("value", null, () => brush.Blend = new Blend { Factors = new float[2], Positions = new float[1] }); 340AssertExtensions.Throws<ArgumentException>(null, () => brush.Blend = new Blend { Factors = [], Positions = [] }); 523Positions = new float[1]
System\Drawing\Drawing2D\PathGradientBrushTests.cs (12)
257brush.Blend = new Blend { Factors = factors, Positions = positions }; 280brush.Blend.Positions = []; 282brush.Blend.Positions = new float[2]; 297yield return new object[] { new Blend() { Factors = [], Positions = [] } }; 298yield return new object[] { new Blend() { Factors = new float[2], Positions = [1, 1] } }; 299yield return new object[] { new Blend() { Factors = new float[2], Positions = [0, 5] } }; 300yield return new object[] { new Blend() { Factors = new float[3], Positions = [0, 1, 5] } }; 301yield return new object[] { new Blend() { Factors = new float[3], Positions = [1, 1, 1] } }; 315Blend invalidBlend = new() { Factors = new float[2], Positions = new float[1] }; 326Assert.Throws<ArgumentNullException>(() => brush.Blend = new Blend() { Factors = null, Positions = null }); 327Assert.Throws<ArgumentNullException>(() => brush.Blend = new Blend() { Factors = null, Positions = [] }); 335brush.Blend = new Blend() { Factors = [], Positions = null });
45 references to Positions
System.Drawing.Common.Tests (45)
System\Drawing\Drawing2D\BlendTests.cs (4)
13Assert.Equal(new float[1], blend.Positions); 23Assert.Equal(new float[count], blend.Positions); 52Assert.Null(blend.Positions); 55Assert.Equal(new float[10], blend.Positions);
System\Drawing\Drawing2D\LinearGradientBrushTests.cs (13)
26Assert.Single(brush.Blend.Positions); 53Assert.Single(brush.Blend.Positions); 87Assert.Single(brush.Blend.Positions); 104Assert.Single(brush.Blend.Positions); 130Assert.Single(brush.Blend.Positions); 147Assert.Single(brush.Blend.Positions); 173Assert.Single(brush.Blend.Positions); 190Assert.Single(brush.Blend.Positions); 240Assert.Equal(brush.Blend.Positions.Length, clone.Blend.Positions.Length); 289Assert.Equal(factors.Length, brush.Blend.Positions.Length); 938Assert.Equal(expectedPositions, brush.Blend.Positions); 952Assert.Equal(expectedPositions, brush.Blend.Positions);
System\Drawing\Drawing2D\PathGradientBrushTests.cs (28)
259Assert.Equal(expectedSize, brush.Blend.Positions.Length); 263Assert.Equal(positions, brush.Blend.Positions); 268Assert.Single(brush.Blend.Positions); 281Assert.Single(brush.Blend.Positions); 283Assert.Single(brush.Blend.Positions); 351Assert.Equal(focus, brush.Blend.Positions[0]); 353Assert.Equal(1f, brush.Blend.Positions[^1]); 358Assert.Equal(0f, brush.Blend.Positions[0]); 360Assert.Equal(focus, brush.Blend.Positions[^1]); 365Assert.Equal(0f, brush.Blend.Positions[0]); 367Assert.Equal(1f, brush.Blend.Positions[^1]); 383Assert.Equal(256, brush.Blend.Positions.Length); 385Assert.Equal(focus, brush.Blend.Positions[0]); 387Assert.Equal(1f, brush.Blend.Positions[^1]); 392Assert.Equal(256, brush.Blend.Positions.Length); 394Assert.Equal(0f, brush.Blend.Positions[0]); 396Assert.Equal(focus, brush.Blend.Positions[^1]); 401Assert.Equal(511, brush.Blend.Positions.Length); 403Assert.Equal(0f, brush.Blend.Positions[0]); 405Assert.Equal(focus, brush.Blend.Positions[255]); 407Assert.Equal(1f, brush.Blend.Positions[^1]); 455Assert.Equal([focus, 1f], brush.Blend.Positions); 460Assert.Equal([0f, focus], brush.Blend.Positions); 465Assert.Equal([0f, focus, 1f], brush.Blend.Positions); 482Assert.Equal([focus, 1f], brush.Blend.Positions); 487Assert.Equal([0f, focus], brush.Blend.Positions); 492Assert.Equal([0f, focus, 1f], brush.Blend.Positions); 944Assert.Single(brush.Blend.Positions);