25 references to new
System.Drawing.Common.Tests (25)
System\Drawing\Drawing2D\ColorBlendTests.cs (3)
11ColorBlend blend = new(); 41ColorBlend blend = new() { Colors = null }; 51ColorBlend blend = new() { Positions = null };
System\Drawing\Drawing2D\LinearGradientBrushTests.cs (13)
261ColorBlend blend = new() 378ColorBlend blend = new() 394InterpolationColors = new ColorBlend 400ColorBlend blend = new() 421Assert.Throws<NullReferenceException>(() => brush.InterpolationColors = new ColorBlend { Colors = null }); 432() => brush.InterpolationColors = new ColorBlend { Colors = new Color[colorsLength] }); 439Assert.Throws<ArgumentException>(() => brush.InterpolationColors = new ColorBlend { Colors = new Color[2], Positions = null }); 449AssertExtensions.Throws<ArgumentException>("value", () => brush.InterpolationColors = new ColorBlend 462AssertExtensions.Throws<ArgumentException>(null, () => brush.InterpolationColors = new ColorBlend 474InterpolationColors = new ColorBlend 483AssertExtensions.Throws<ArgumentException>(null, () => brush.InterpolationColors = new ColorBlend 495InterpolationColors = new ColorBlend 514InterpolationColors = new ColorBlend
System\Drawing\Drawing2D\PathGradientBrushTests.cs (9)
535brush.InterpolationColors = new ColorBlend() { Colors = expectedColors, Positions = expectedPositions }; 539brush.InterpolationColors = new ColorBlend() { Colors = sameColors, Positions = expectedPositions }; 585brush.InterpolationColors = new ColorBlend() { Colors = null, Positions = null }); 588brush.InterpolationColors = new ColorBlend() { Colors = null, Positions = new float[2] }); 596brush.InterpolationColors = new ColorBlend() { Colors = new Color[1], Positions = null }); 603AssertExtensions.Throws<ArgumentException>(null, () => brush.InterpolationColors = new ColorBlend()); 611brush.InterpolationColors = new ColorBlend() { Colors = [], Positions = [] }); 619brush.InterpolationColors = new ColorBlend() { Colors = new Color[1], Positions = new float[2] }); 627brush.InterpolationColors = new ColorBlend() { Colors = new Color[2], Positions = new float[1] });