21 writes to Factors
System.Drawing.Common.Tests (21)
System\Drawing\Drawing2D\BlendTests.cs (2)
41Blend blend = new() { Factors = null }; 44blend.Factors = new float[10];
System\Drawing\Drawing2D\LinearGradientBrushTests.cs (7)
283Factors = factors, 302Factors = factors, 319Assert.Throws<ArgumentNullException>(() => brush.Blend = new Blend { Factors = null }); 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 = [] }); 522Factors = new float[1],
System\Drawing\Drawing2D\PathGradientBrushTests.cs (12)
257brush.Blend = new Blend { Factors = factors, Positions = positions }; 276brush.Blend.Factors = []; 278brush.Blend.Factors = 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 });
46 references to Factors
System.Drawing.Common.Tests (46)
System\Drawing\Drawing2D\BlendTests.cs (4)
12Assert.Equal(new float[1], blend.Factors); 22Assert.Equal(new float[count], blend.Factors); 42Assert.Null(blend.Factors); 45Assert.Equal(new float[10], blend.Factors);
System\Drawing\Drawing2D\LinearGradientBrushTests.cs (14)
25Assert.Equal([1], brush.Blend.Factors); 52Assert.Equal([1], brush.Blend.Factors); 86Assert.Equal([1], brush.Blend.Factors); 103Assert.Equal([1], brush.Blend.Factors); 129Assert.Equal([1], brush.Blend.Factors); 146Assert.Equal([1], brush.Blend.Factors); 172Assert.Equal([1], brush.Blend.Factors); 189Assert.Equal([1], brush.Blend.Factors); 239Assert.Equal(brush.Blend.Factors, clone.Blend.Factors); 288Assert.Equal(blend.Factors, brush.Blend.Factors); 937Assert.Equal(expectedFactors, brush.Blend.Factors); 951Assert.Equal(expectedFactors, brush.Blend.Factors);
System\Drawing\Drawing2D\PathGradientBrushTests.cs (28)
258Assert.Equal(factors, brush.Blend.Factors); 262Assert.Equal(factors, brush.Blend.Factors); 267Assert.Equal(factors, brush.Blend.Factors); 277Assert.Equal(1, brush.Blend.Factors.Length); 279Assert.Equal(1, brush.Blend.Factors.Length); 352Assert.Equal(defaultScale, brush.Blend.Factors[0]); 354Assert.Equal(0f, brush.Blend.Factors[^1]); 359Assert.Equal(0f, brush.Blend.Factors[0]); 361Assert.Equal(defaultScale, brush.Blend.Factors[^1]); 366Assert.Equal(0f, brush.Blend.Factors[0]); 368Assert.Equal(0f, brush.Blend.Factors[^1]); 384Assert.Equal(256, brush.Blend.Factors.Length); 386Assert.Equal(1f, brush.Blend.Factors[0]); 388Assert.Equal(0f, brush.Blend.Factors[^1]); 393Assert.Equal(256, brush.Blend.Factors.Length); 395Assert.Equal(0f, brush.Blend.Factors[0]); 397Assert.Equal(1f, brush.Blend.Factors[^1]); 402Assert.Equal(511, brush.Blend.Factors.Length); 404Assert.Equal(0f, brush.Blend.Factors[0]); 406Assert.Equal(1f, brush.Blend.Factors[255]); 408Assert.Equal(0f, brush.Blend.Factors[^1]); 454Assert.Equal([defaultScale, 0f], brush.Blend.Factors); 459Assert.Equal([0f, defaultScale], brush.Blend.Factors); 464Assert.Equal([0f, defaultScale, 0f], brush.Blend.Factors); 481Assert.Equal([1f, 0f], brush.Blend.Factors); 486Assert.Equal([0f, 1f], brush.Blend.Factors); 491Assert.Equal([0f, 1f, 0f], brush.Blend.Factors); 943Assert.Equal([1], brush.Blend.Factors);