21 references to new
System.Drawing.Common.Tests (21)
System\Drawing\Drawing2D\BlendTests.cs (3)
11Blend blend = new(); 41Blend blend = new() { Factors = null }; 51Blend blend = new() { Positions = null };
System\Drawing\Drawing2D\LinearGradientBrushTests.cs (8)
281Blend blend = new() 300Blend blend = new() 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 = [] }); 350AssertExtensions.Throws<ArgumentException>(null, () => brush.Blend = new Blend()); 520brush.Blend = new Blend
System\Drawing\Drawing2D\PathGradientBrushTests.cs (10)
257brush.Blend = new Blend { Factors = factors, Positions = positions }; 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 });