1189 references to AssertExtensions
Microsoft.VisualBasic.Tests (2)
Microsoft\VisualBasic\ApplicationServices\StartupEventArgsTests.cs (1)
21AssertExtensions.Throws<ArgumentNullException>("list", () => new StartupEventArgs(null));
Microsoft\VisualBasic\ApplicationServices\StartupNextInstanceEventArgsTests.cs (1)
24AssertExtensions.Throws<ArgumentNullException>("list", () => new StartupNextInstanceEventArgs(null, bringToForegroundFlag: true));
System.Drawing.Common.Tests (1171)
mono\System.Drawing\GraphicsTests.cs (1)
350Exception exception = AssertExtensions.Throws<ArgumentException, Exception>(() => Graphics.FromImage(img));
System\Drawing\BitmapTests.cs (89)
69AssertExtensions.Throws<ArgumentNullException>("path", () => new Bitmap((string)null)); 70AssertExtensions.Throws<ArgumentNullException>("path", () => new Bitmap((string)null, false)); 79AssertExtensions.Throws<ArgumentException>(paramName, null, () => new Bitmap(filename)); 80AssertExtensions.Throws<ArgumentException>(paramName, null, () => new Bitmap(filename, false)); 81AssertExtensions.Throws<ArgumentException>(paramName, null, () => new Bitmap(filename, true)); 97AssertExtensions.Throws<ArgumentNullException, NullReferenceException>("type", () => new Bitmap(null, "name")); 107AssertExtensions.Throws<ArgumentException>(null, () => new Bitmap(type, resource)); 113AssertExtensions.Throws<ArgumentNullException, ArgumentException>("resource", null, () => new Bitmap(typeof(Bitmap), null)); 146AssertExtensions.Throws<ArgumentNullException, ArgumentException>("stream", null, () => new Bitmap((Stream)null)); 147AssertExtensions.Throws<ArgumentNullException, ArgumentException>("stream", null, () => new Bitmap((Stream)null, false)); 154AssertExtensions.Throws<ArgumentException>(null, () => new Bitmap(stream)); 155AssertExtensions.Throws<ArgumentException>(null, () => new Bitmap(stream, false)); 156AssertExtensions.Throws<ArgumentException>(null, () => new Bitmap(stream, true)); 221AssertExtensions.Throws<ArgumentException>(null, () => new Bitmap(width, 1)); 222AssertExtensions.Throws<ArgumentException>(null, () => new Bitmap(width, 1, Graphics.FromImage(new Bitmap(1, 1)))); 223AssertExtensions.Throws<ArgumentException>(null, () => new Bitmap(new Bitmap(1, 1), width, 1)); 224AssertExtensions.Throws<ArgumentException>(null, () => new Bitmap(new Bitmap(1, 1), new Size(width, 1))); 225AssertExtensions.Throws<ArgumentException>(null, () => new Bitmap(width, 1, PixelFormat.Format16bppArgb1555)); 226AssertExtensions.Throws<ArgumentException>(null, () => new Bitmap(width, 1, 0, PixelFormat.Format16bppArgb1555, IntPtr.Zero)); 236AssertExtensions.Throws<ArgumentException>(null, () => new Bitmap(1, height)); 237AssertExtensions.Throws<ArgumentException>(null, () => new Bitmap(1, height, Graphics.FromImage(new Bitmap(1, 1)))); 238AssertExtensions.Throws<ArgumentException>(null, () => new Bitmap(new Bitmap(1, 1), 1, height)); 239AssertExtensions.Throws<ArgumentException>(null, () => new Bitmap(new Bitmap(1, 1), new Size(1, height))); 240AssertExtensions.Throws<ArgumentException>(null, () => new Bitmap(1, height, PixelFormat.Format16bppArgb1555)); 241AssertExtensions.Throws<ArgumentException>(null, () => new Bitmap(1, height, 0, PixelFormat.Format16bppArgb1555, IntPtr.Zero)); 257AssertExtensions.Throws<ArgumentException>(null, () => new Bitmap(1, 1, format)); 258AssertExtensions.Throws<ArgumentException>(null, () => new Bitmap(1, 1, 0, format, IntPtr.Zero)); 264AssertExtensions.Throws<ArgumentException>(null, () => new Bitmap(1, 1, 0, PixelFormat.Format16bppArgb1555, 10)); 297AssertExtensions.Throws<ArgumentNullException>("g", null, () => new Bitmap(1, 1, null)); 342AssertExtensions.Throws<ArgumentNullException>("original", "image", () => new Bitmap(null, new Size(1, 2))); 343AssertExtensions.Throws<ArgumentNullException>("original", "image", () => new Bitmap(null, 1, 2)); 352AssertExtensions.Throws<ArgumentException>(null, () => new Bitmap(image)); 353AssertExtensions.Throws<ArgumentException>(null, () => new Bitmap(image, 1, 1)); 354AssertExtensions.Throws<ArgumentException>(null, () => new Bitmap(image, new Size(1, 1))); 426AssertExtensions.Throws<ArgumentException>(null, () => bitmap.Clone(new Rectangle(0, 0, width, height), bitmap.PixelFormat)); 427AssertExtensions.Throws<ArgumentException>(null, () => bitmap.Clone(new RectangleF(0, 0, width, height), bitmap.PixelFormat)); 484AssertExtensions.Throws<ArgumentException>(null, () => bitmap.Clone()); 485AssertExtensions.Throws<ArgumentException>(null, () => bitmap.Clone(new Rectangle(0, 0, 1, 1), PixelFormat.Format32bppArgb)); 486AssertExtensions.Throws<ArgumentException>(null, () => bitmap.Clone(new RectangleF(0, 0, 1, 1), PixelFormat.Format32bppArgb)); 505AssertExtensions.Throws<ArgumentException>(null, () => bitmap.GetFrameCount(FrameDimension.Page)); 527AssertExtensions.Throws<ArgumentException>(null, () => bitmap.SelectActiveFrame(FrameDimension.Page, 0)); 559AssertExtensions.Throws<ArgumentOutOfRangeException>("x", () => bitmap.GetPixel(x, 0)); 568AssertExtensions.Throws<ArgumentOutOfRangeException>("y", () => bitmap.GetPixel(0, y)); 575AssertExtensions.Throws<ArgumentException>(null, () => bitmap.GetPixel(0, 0)); 584AssertExtensions.Throws<ArgumentException>(null, () => bitmap.GetPixel(0, 0)); 640AssertExtensions.Throws<ArgumentException>(null, () => bitmap.GetHbitmap()); 649AssertExtensions.Throws<ArgumentException>(null, () => bitmap.GetHbitmap()); 713AssertExtensions.Throws<ArgumentException>(null, () => bitmap.GetHicon()); 722AssertExtensions.Throws<ArgumentException>(null, () => bitmap.GetHicon()); 760AssertExtensions.Throws<ArgumentException>(null, () => Bitmap.FromHicon(IntPtr.Zero)); 761AssertExtensions.Throws<ArgumentException>(null, () => Bitmap.FromHicon(10)); 768AssertExtensions.Throws<ArgumentException>(null, () => Bitmap.FromHicon(icon.Handle)); 774AssertExtensions.Throws<ArgumentException>(null, () => Bitmap.FromResource(IntPtr.Zero, "Name")); 775AssertExtensions.Throws<ArgumentException>(null, () => Bitmap.FromResource(10, "Name")); 781AssertExtensions.Throws<ArgumentException>(null, () => Bitmap.FromResource(IntPtr.Zero, "Name")); 782AssertExtensions.Throws<ArgumentException>(null, () => Bitmap.FromResource(10, "Name")); 885AssertExtensions.Throws<ArgumentException>(null, () => bitmap.MakeTransparent()); 886AssertExtensions.Throws<ArgumentException>(null, () => bitmap.MakeTransparent(Color.Red)); 893AssertExtensions.Throws<ArgumentException>(null, () => bitmap.MakeTransparent()); 942AssertExtensions.Throws<ArgumentOutOfRangeException>("x", () => bitmap.SetPixel(x, 0, Color.Red)); 951AssertExtensions.Throws<ArgumentOutOfRangeException>("y", () => bitmap.SetPixel(0, y, Color.Red)); 958AssertExtensions.Throws<ArgumentException>(null, () => bitmap.SetPixel(0, 0, Color.Red)); 967AssertExtensions.Throws<ArgumentException>(null, () => bitmap.SetPixel(0, 0, Color.Red)); 988AssertExtensions.Throws<ArgumentException>(null, () => bitmap.SetResolution(xDpi, 1)); 999AssertExtensions.Throws<ArgumentException>(null, () => bitmap.SetResolution(1, yDpi)); 1008AssertExtensions.Throws<ArgumentException>(null, () => bitmap.SetResolution(1, 1)); 1078AssertExtensions.Throws<ArgumentException>(null, () => bitmap.UnlockBits(data)); 1095AssertExtensions.Throws<ArgumentNullException>("bitmapData", () => bitmap.LockBits(Rectangle.Empty, ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb, null)); 1113AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(x, y, width, height), ImageLockMode.ReadOnly, bitmap.PixelFormat)); 1116AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(x, y, width, height), ImageLockMode.ReadOnly, bitmap.PixelFormat, bitmapData)); 1134AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(0, 0, 1, 1), lockMode, format)); 1137AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(0, 0, 1, 1), lockMode, format, bitmapData)); 1146AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadOnly, PixelFormat.Format16bppGrayScale)); 1147AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadOnly, PixelFormat.Format16bppGrayScale, new BitmapData())); 1149AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadWrite, PixelFormat.Format16bppGrayScale)); 1150AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadWrite, PixelFormat.Format16bppGrayScale, new BitmapData())); 1153AssertExtensions.Throws<ArgumentException>(null, () => bitmap.UnlockBits(data)); 1163AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(0, 0, 1, 1), lockMode, bitmap.PixelFormat)); 1166AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(0, 0, 1, 1), lockMode, bitmap.PixelFormat, bitmapData)); 1175AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb)); 1178AssertExtensions.Throws<ArgumentException>(null, () => bitmap.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb, bitmapData)); 1235AssertExtensions.Throws<ArgumentNullException>("bitmapdata", () => bitmap.UnlockBits(null)); 1261AssertExtensions.Throws<ArgumentException>(null, () => bitmap.UnlockBits(new BitmapData())); 1270AssertExtensions.Throws<ArgumentException>(null, () => bitmap.Width); 1271AssertExtensions.Throws<ArgumentException>(null, () => bitmap.Height); 1272AssertExtensions.Throws<ArgumentException>(null, () => bitmap.Size); 1457AssertExtensions.Throws<ArgumentException>(null, () => bitmap.Palette); 1458AssertExtensions.Throws<ArgumentException>(null, () => bitmap.Palette = palette); 1459AssertExtensions.Throws<ArgumentException>(null, () => bitmap.Size);
System\Drawing\BufferedGraphicsContextTests.cs (5)
123AssertExtensions.Throws<ArgumentException>(null, () => context.Allocate(-1, new Rectangle(0, 0, 10, 10))); 151AssertExtensions.Throws<ArgumentException>(null, () => context.Allocate(graphics, largeRectangle)); 152AssertExtensions.Throws<ArgumentException>(null, () => context.Allocate(graphics, Rectangle.Empty)); 200AssertExtensions.Throws<ArgumentException>("value", null, () => context.MaximumBuffer = new Size(width, 1)); 209AssertExtensions.Throws<ArgumentException>("value", null, () => context.MaximumBuffer = new Size(1, height));
System\Drawing\ColorTranslatorTests.cs (1)
210Exception exception = AssertExtensions.Throws<ArgumentException, Exception>(() => ColorTranslator.FromHtml(htmlColor));
System\Drawing\Drawing2D\CustomLineCapTests.cs (10)
72AssertExtensions.Throws<ArgumentException>(null, () => new CustomLineCap(fillPath, null)); 112AssertExtensions.Throws<ArgumentException>(null, () => customLineCap.SetStrokeCaps(startCap, endCap)); 161AssertExtensions.Throws<ArgumentException>(null, () => customLineCap.BaseCap = baseCap); 213AssertExtensions.Throws<ArgumentException>(null, () => customLineCap.StrokeJoin); 214AssertExtensions.Throws<ArgumentException>(null, () => customLineCap.BaseCap); 215AssertExtensions.Throws<ArgumentException>(null, () => customLineCap.BaseInset); 216AssertExtensions.Throws<ArgumentException>(null, () => customLineCap.WidthScale); 217AssertExtensions.Throws<ArgumentException>(null, () => customLineCap.Clone()); 218AssertExtensions.Throws<ArgumentException>(null, () => customLineCap.SetStrokeCaps(LineCap.Flat, LineCap.Flat)); 219AssertExtensions.Throws<ArgumentException>(null, () => customLineCap.GetStrokeCaps(out LineCap startCap, out LineCap endCap));
System\Drawing\Drawing2D\GraphicsPathIteratorTests.cs (5)
264AssertExtensions.Throws<ArgumentException>(null, () => gpi.Enumerate(ref points, ref types)); 277AssertExtensions.Throws<ArgumentException>(null, () => gpi.Enumerate(ref points, ref types)); 302AssertExtensions.Throws<ArgumentException>(null, () => gpi.CopyData(ref points, ref types, 0, points.Length)); 324AssertExtensions.Throws<ArgumentException>(null, () => gpi.CopyData(ref resultPoints, ref resultTypes, startIndex, endIndex)); 343AssertExtensions.Throws<ArgumentException>(null, () => gpi.CopyData(ref resultPoints, ref resultTypes, startIndex, endIndex));
System\Drawing\Drawing2D\GraphicsPathTests.cs (57)
82AssertExtensions.Throws<ArgumentNullException>("pts", () => new GraphicsPath((Point[])null, new byte[1])); 95AssertExtensions.Throws<ArgumentException>(null, () => new GraphicsPath(new Point[pointsLength], new byte[typesLength])); 96AssertExtensions.Throws<ArgumentException>(null, () => new GraphicsPath(new PointF[pointsLength], new byte[typesLength])); 316AssertExtensions.Throws<ArgumentNullException>("points", () => new GraphicsPath().AddLines((Point[])null)); 317AssertExtensions.Throws<ArgumentNullException>("points", () => new GraphicsPath().AddLines((PointF[])null)); 323AssertExtensions.Throws<ArgumentException>("points", null, () => new GraphicsPath().AddLines(new Point[0])); 324AssertExtensions.Throws<ArgumentException>("points", null, () => new GraphicsPath().AddLines(new PointF[0])); 360AssertExtensions.Throws<ArgumentException>(null, () => gp.AddArc(1, 1, width, height, Pi4, Pi4)); 361AssertExtensions.Throws<ArgumentException>(null, () => gp.AddArc(1.0f, 1.0f, width, height, Pi4, Pi4)); 427AssertExtensions.Throws<ArgumentNullException>("points", () => gp.AddBeziers((PointF[])null)); 428AssertExtensions.Throws<ArgumentNullException>("points", () => gp.AddBeziers((Point[])null)); 444AssertExtensions.Throws<ArgumentException>(null, () => gp.AddBeziers(points)); 558AssertExtensions.Throws<ArgumentException>(null, () => gp.AddCurve((PointF[])null)); 559AssertExtensions.Throws<ArgumentException>(null, () => gp.AddCurve((Point[])null)); 573AssertExtensions.ThrowsAny<ArgumentException, ArgumentOutOfRangeException>(() => gp.AddCurve(points)); 574AssertExtensions.ThrowsAny<ArgumentException, ArgumentOutOfRangeException>(() => gp.AddCurve(points, 0, 2, 0.5f)); 588AssertExtensions.ThrowsAny<ArgumentException, ArgumentOutOfRangeException>(() => gp.AddCurve(points)); 589AssertExtensions.ThrowsAny<ArgumentException, ArgumentOutOfRangeException>(() => gp.AddCurve(points, 0, 2, 0.5f)); 603AssertExtensions.ThrowsAny<ArgumentException, ArgumentOutOfRangeException>( 606AssertExtensions.ThrowsAny<ArgumentException, ArgumentOutOfRangeException>( 614AssertExtensions.ThrowsAny<ArgumentException, ArgumentOutOfRangeException>( 617AssertExtensions.ThrowsAny<ArgumentException, ArgumentOutOfRangeException>( 666AssertExtensions.Throws<ArgumentNullException>("points", () => gp.AddClosedCurve((PointF[])null)); 667AssertExtensions.Throws<ArgumentNullException>("points", () => gp.AddClosedCurve((Point[])null)); 682AssertExtensions.Throws<ArgumentException>(null, () => gp.AddClosedCurve(points)); 697AssertExtensions.Throws<ArgumentException>(null, () => gp.AddClosedCurve(points)); 806AssertExtensions.Throws<ArgumentNullException>("rects", () => gp.AddRectangles((RectangleF[])null)); 807AssertExtensions.Throws<ArgumentNullException>("rects", () => gp.AddRectangles((Rectangle[])null)); 879AssertExtensions.Throws<ArgumentException>(null, () => gp.AddPie(1, 1, height, width, Pi4, Pi4)); 880AssertExtensions.Throws<ArgumentException>(null, () => gp.AddPie(1f, 1f, height, width, Pi4, Pi4)); 881AssertExtensions.Throws<ArgumentException>(null, () => gp.AddPie(new Rectangle(1, 1, height, width), Pi4, Pi4)); 939AssertExtensions.Throws<ArgumentNullException>("points", () => new GraphicsPath().AddPolygon((Point[])null)); 940AssertExtensions.Throws<ArgumentNullException>("points", () => new GraphicsPath().AddPolygon((PointF[])null)); 955AssertExtensions.Throws<ArgumentException>(null, () => gp.AddPolygon(points)); 970AssertExtensions.Throws<ArgumentException>(null, () => gp.AddPolygon(points)); 987AssertExtensions.Throws<ArgumentNullException>("addingPath", () => new GraphicsPath().AddPath(null, false)); 996AssertExtensions.GreaterThan(gpi.PointCount, 0); 999AssertExtensions.GreaterThan(gpf.PointCount, 0); 1008AssertExtensions.GreaterThan(gpi.PointCount, 0); 1011AssertExtensions.GreaterThan(gpf.PointCount, 0); 1020AssertExtensions.GreaterThan(gpi.PointCount, 0); 1024AssertExtensions.GreaterThan(gpi.PointCount, gpiLengthOld); 1027AssertExtensions.GreaterThan(gpf.PointCount, 0); 1031AssertExtensions.GreaterThan(gpf.PointCount, pgfLengthOld); 1041AssertExtensions.GreaterThan(gp1.PointCount, 0); 1080AssertExtensions.Throws<ArgumentNullException, ArgumentException>("family", null, () => 1112AssertExtensions.Throws<ArgumentNullException>("matrix", () => gp.Transform(null)); 1281AssertExtensions.Throws<ArgumentNullException>("destPoints", () => gp.Warp(null, new RectangleF())); 1288AssertExtensions.Throws<ArgumentException>(null, () => new GraphicsPath().Warp([], new RectangleF())); 1684AssertExtensions.Throws<ArgumentNullException>("pen", () => gp.Widen(null)); 1685AssertExtensions.Throws<ArgumentNullException>("pen", () => gp.Widen(null, new Matrix())); 1686AssertExtensions.Throws<ArgumentNullException>("pen", () => gp.Widen(null, new Matrix(), 0.67f)); 1739AssertExtensions.Throws<ArgumentNullException>("pen", () => gp.IsOutlineVisible(1, 1, null)); 1740AssertExtensions.Throws<ArgumentNullException>("pen", () => gp.IsOutlineVisible(1.0f, 1.0f, null)); 1741AssertExtensions.Throws<ArgumentNullException>("pen", () => gp.IsOutlineVisible(new Point(), null)); 1742AssertExtensions.Throws<ArgumentNullException>("pen", () => gp.IsOutlineVisible(new PointF(), null)); 2071AssertExtensions.LessThanOrEqualTo(Math.Abs(expexted - actual), tollerance);
System\Drawing\Drawing2D\HatchBrushTests.cs (6)
52AssertExtensions.Throws<ArgumentException>("hatchstyle", null, () => new HatchBrush(hatchStyle, Color.Empty)); 53AssertExtensions.Throws<ArgumentException>("hatchstyle", null, () => new HatchBrush(hatchStyle, Color.Empty, Color.Empty)); 85AssertExtensions.Throws<ArgumentException>(null, () => brush.Clone()); 94AssertExtensions.Throws<ArgumentException>(null, () => brush.HatchStyle); 103AssertExtensions.Throws<ArgumentException>(null, () => brush.ForegroundColor); 112AssertExtensions.Throws<ArgumentException>(null, () => brush.BackgroundColor);
System\Drawing\Drawing2D\LinearGradientBrushTests.cs (62)
204AssertExtensions.Throws<ArgumentException>(null, () => new LinearGradientBrush(new Rectangle(1, 2, 0, 4), Color.Empty, Color.Empty, 0f)); 205AssertExtensions.Throws<ArgumentException>(null, () => new LinearGradientBrush(new RectangleF(1, 2, 0, 4), Color.Empty, Color.Empty, 0f)); 206AssertExtensions.Throws<ArgumentException>(null, () => new LinearGradientBrush(new Rectangle(1, 2, 0, 4), Color.Empty, Color.Empty, LinearGradientMode.BackwardDiagonal)); 207AssertExtensions.Throws<ArgumentException>(null, () => new LinearGradientBrush(new RectangleF(1, 2, 0, 4), Color.Empty, Color.Empty, LinearGradientMode.BackwardDiagonal)); 208AssertExtensions.Throws<ArgumentException>(null, () => new LinearGradientBrush(new Rectangle(1, 2, 0, 4), Color.Empty, Color.Empty, 0, true)); 209AssertExtensions.Throws<ArgumentException>(null, () => new LinearGradientBrush(new RectangleF(1, 2, 0, 4), Color.Empty, Color.Empty, 0, true)); 215AssertExtensions.Throws<ArgumentException>(null, () => new LinearGradientBrush(new Rectangle(1, 2, 3, 0), Color.Empty, Color.Empty, 0f)); 216AssertExtensions.Throws<ArgumentException>(null, () => new LinearGradientBrush(new RectangleF(1, 2, 3, 0), Color.Empty, Color.Empty, 0f)); 217AssertExtensions.Throws<ArgumentException>(null, () => new LinearGradientBrush(new Rectangle(1, 2, 3, 0), Color.Empty, Color.Empty, LinearGradientMode.BackwardDiagonal)); 218AssertExtensions.Throws<ArgumentException>(null, () => new LinearGradientBrush(new RectangleF(1, 2, 3, 0), Color.Empty, Color.Empty, LinearGradientMode.BackwardDiagonal)); 219AssertExtensions.Throws<ArgumentException>(null, () => new LinearGradientBrush(new Rectangle(1, 2, 3, 0), Color.Empty, Color.Empty, 0, true)); 220AssertExtensions.Throws<ArgumentException>(null, () => new LinearGradientBrush(new RectangleF(1, 2, 3, 0), Color.Empty, Color.Empty, 0, true)); 252AssertExtensions.Throws<ArgumentException>(null, () => brush.Clone()); 305AssertExtensions.Throws<ArgumentException>(null, () => brush.Blend = blend); 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 = [] }); 349AssertExtensions.Throws<ArgumentException>(null, () => brush.Blend); 350AssertExtensions.Throws<ArgumentException>(null, () => brush.Blend = new Blend()); 368AssertExtensions.Throws<ArgumentException>(null, () => brush.GammaCorrection); 369AssertExtensions.Throws<ArgumentException>(null, () => brush.GammaCorrection = true); 412AssertExtensions.Throws<ArgumentNullException>("value", () => brush.InterpolationColors = null); 428AssertExtensions.Throws<ArgumentException>( 447AssertExtensions.Throws<ArgumentException>("value", () => brush.InterpolationColors = new ColorBlend 460AssertExtensions.Throws<ArgumentException>(null, () => brush.InterpolationColors = new ColorBlend 480AssertExtensions.Throws<ArgumentException>(null, () => brush.InterpolationColors); 481AssertExtensions.Throws<ArgumentException>(null, () => brush.InterpolationColors = new ColorBlend 561AssertExtensions.Throws<ArgumentException>(null, () => brush.LinearColors); 562AssertExtensions.Throws<ArgumentException>(null, () => brush.LinearColors = [Color.Red, Color.Wheat]); 571AssertExtensions.Throws<ArgumentException>(null, () => brush.Rectangle); 586AssertExtensions.Throws<ArgumentNullException>("value", "matrix", () => brush.Transform = null); 595AssertExtensions.Throws<ArgumentException>(null, () => brush.Transform); 596AssertExtensions.Throws<ArgumentException>(null, () => brush.Transform = new Matrix()); 623AssertExtensions.Throws<ArgumentException>(null, () => brush.WrapMode = WrapMode.Clamp); 632AssertExtensions.Throws<ArgumentException>(null, () => brush.WrapMode); 633AssertExtensions.Throws<ArgumentException>(null, () => brush.WrapMode = WrapMode.TileFlipX); 652AssertExtensions.Throws<ArgumentException>(null, () => brush.ResetTransform()); 696AssertExtensions.Throws<ArgumentNullException>("matrix", () => brush.MultiplyTransform(null)); 697AssertExtensions.Throws<ArgumentNullException>("matrix", () => brush.MultiplyTransform(null, MatrixOrder.Append)); 719AssertExtensions.Throws<ArgumentException>(null, () => brush.MultiplyTransform(matrix)); 720AssertExtensions.Throws<ArgumentException>(null, () => brush.MultiplyTransform(matrix, MatrixOrder.Append)); 729AssertExtensions.Throws<ArgumentException>(null, () => brush.MultiplyTransform(new Matrix())); 730AssertExtensions.Throws<ArgumentException>(null, () => brush.MultiplyTransform(new Matrix(), MatrixOrder.Prepend)); 770AssertExtensions.Throws<ArgumentException>(null, () => brush.TranslateTransform(0, 0, order)); 779AssertExtensions.Throws<ArgumentException>(null, () => brush.TranslateTransform(0, 0)); 780AssertExtensions.Throws<ArgumentException>(null, () => brush.TranslateTransform(0, 0, MatrixOrder.Append)); 820AssertExtensions.Throws<ArgumentException>(null, () => brush.ScaleTransform(0, 0, order)); 829AssertExtensions.Throws<ArgumentException>(null, () => brush.ScaleTransform(0, 0)); 830AssertExtensions.Throws<ArgumentException>(null, () => brush.ScaleTransform(0, 0, MatrixOrder.Append)); 871AssertExtensions.Throws<ArgumentException>(null, () => brush.RotateTransform(0, order)); 880AssertExtensions.Throws<ArgumentException>(null, () => brush.RotateTransform(0)); 881AssertExtensions.Throws<ArgumentException>(null, () => brush.RotateTransform(0, MatrixOrder.Append)); 903AssertExtensions.Throws<ArgumentException>(null, null, () => brush.SetSigmaBellShape(focus)); 904AssertExtensions.Throws<ArgumentException>(null, null, () => brush.SetSigmaBellShape(focus, 1)); 915AssertExtensions.Throws<ArgumentException>(null, null, () => brush.SetSigmaBellShape(0.1f, scale)); 924AssertExtensions.Throws<ArgumentException>(null, () => brush.SetSigmaBellShape(0)); 925AssertExtensions.Throws<ArgumentException>(null, () => brush.SetSigmaBellShape(0, 1)); 963AssertExtensions.Throws<ArgumentException>(null, null, () => brush.SetBlendTriangularShape(focus)); 964AssertExtensions.Throws<ArgumentException>(null, null, () => brush.SetBlendTriangularShape(focus, 1)); 975AssertExtensions.Throws<ArgumentException>(null, null, () => brush.SetBlendTriangularShape(0.1f, scale)); 984AssertExtensions.Throws<ArgumentException>(null, () => brush.SetBlendTriangularShape(0)); 985AssertExtensions.Throws<ArgumentException>(null, () => brush.SetBlendTriangularShape(0, 1));
System\Drawing\Drawing2D\MatrixTests.cs (54)
130AssertExtensions.Throws<ArgumentNullException>("plgpts", () => new Matrix(new RectangleF(), null)); 131AssertExtensions.Throws<ArgumentNullException>("plgpts", () => new Matrix(new Rectangle(), null)); 140AssertExtensions.Throws<ArgumentException>(null, () => new Matrix(new RectangleF(), new PointF[length])); 141AssertExtensions.Throws<ArgumentException>(null, () => new Matrix(new Rectangle(), new Point[length])); 170AssertExtensions.Throws<ArgumentException>(null, () => CreateDisposedMatrix().Clone()); 216AssertExtensions.Throws<ArgumentException>(null, () => CreateDisposedMatrix().Equals(new Matrix())); 222AssertExtensions.Throws<ArgumentException>(null, () => new Matrix().Equals(CreateDisposedMatrix())); 228AssertExtensions.Throws<ArgumentException>(null, () => CreateDisposedMatrix().Elements); 261AssertExtensions.Throws<ArgumentException>(null, () => matrix1.Invert()); 262AssertExtensions.Throws<ArgumentException>(null, () => matrix2.Invert()); 263AssertExtensions.Throws<ArgumentException>(null, () => matrix3.Invert()); 264AssertExtensions.Throws<ArgumentException>(null, () => matrix4.Invert()); 265AssertExtensions.Throws<ArgumentException>(null, () => matrix5.Invert()); 266AssertExtensions.Throws<ArgumentException>(null, () => matrix6.Invert()); 272AssertExtensions.Throws<ArgumentException>(null, () => CreateDisposedMatrix().Invert()); 278AssertExtensions.Throws<ArgumentException>(null, () => CreateDisposedMatrix().IsIdentity); 284AssertExtensions.Throws<ArgumentException>(null, () => CreateDisposedMatrix().IsInvertible); 337AssertExtensions.Throws<ArgumentNullException>("matrix", () => matrix.Multiply(null)); 338AssertExtensions.Throws<ArgumentNullException>("matrix", () => matrix.Multiply(null, MatrixOrder.Prepend)); 348AssertExtensions.Throws<ArgumentException>(null, () => matrix.Multiply(other, order)); 357AssertExtensions.Throws<ArgumentException>(null, () => disposedMatrix.Multiply(other)); 358AssertExtensions.Throws<ArgumentException>(null, () => disposedMatrix.Multiply(other, MatrixOrder.Prepend)); 367AssertExtensions.Throws<ArgumentException>(null, () => matrix.Multiply(disposedMatrix)); 368AssertExtensions.Throws<ArgumentException>(null, () => matrix.Multiply(disposedMatrix, MatrixOrder.Prepend)); 393AssertExtensions.Throws<ArgumentException>(null, () => CreateDisposedMatrix().Reset()); 477AssertExtensions.Throws<ArgumentException>(null, () => CreateDisposedMatrix().Rotate(1, MatrixOrder.Append)); 486AssertExtensions.Throws<ArgumentException>(null, () => matrix.Rotate(1, order)); 494AssertExtensions.Throws<ArgumentException>(null, () => disposedMatrix.RotateAt(1, PointF.Empty)); 495AssertExtensions.Throws<ArgumentException>(null, () => disposedMatrix.RotateAt(1, PointF.Empty, MatrixOrder.Append)); 504AssertExtensions.Throws<ArgumentException>(null, () => matrix.RotateAt(1, PointF.Empty, order)); 561AssertExtensions.Throws<ArgumentException>(null, () => matrix.Shear(1, 2, order)); 569AssertExtensions.Throws<ArgumentException>(null, () => disposedMatrix.Scale(1, 2)); 570AssertExtensions.Throws<ArgumentException>(null, () => disposedMatrix.Scale(1, 2, MatrixOrder.Append)); 627AssertExtensions.Throws<ArgumentException>(null, () => matrix.Shear(1, 2, order)); 635AssertExtensions.Throws<ArgumentException>(null, () => disposedMatrix.Shear(1, 2)); 636AssertExtensions.Throws<ArgumentException>(null, () => disposedMatrix.Shear(1, 2, MatrixOrder.Append)); 684AssertExtensions.Throws<ArgumentException>(null, () => matrix.Translate(1, 2, order)); 692AssertExtensions.Throws<ArgumentException>(null, () => disposedMatrix.Translate(1, 2)); 693AssertExtensions.Throws<ArgumentException>(null, () => disposedMatrix.Translate(1, 2, MatrixOrder.Append)); 730AssertExtensions.Throws<ArgumentNullException>("pts", () => matrix.TransformPoints((Point[])null)); 731AssertExtensions.Throws<ArgumentNullException>("pts", () => matrix.TransformPoints((PointF[])null)); 738AssertExtensions.Throws<ArgumentException>(null, () => matrix.TransformPoints(new Point[0])); 739AssertExtensions.Throws<ArgumentException>(null, () => matrix.TransformPoints(new PointF[0])); 747AssertExtensions.Throws<ArgumentException>(null, () => disposedMatrix.TransformPoints(new Point[1])); 748AssertExtensions.Throws<ArgumentException>(null, () => disposedMatrix.TransformPoints(new PointF[1])); 796AssertExtensions.Throws<ArgumentNullException>("pts", () => matrix.VectorTransformPoints(null)); 797AssertExtensions.Throws<ArgumentNullException>("pts", () => matrix.TransformVectors((Point[])null)); 798AssertExtensions.Throws<ArgumentNullException>("pts", () => matrix.TransformVectors((PointF[])null)); 805AssertExtensions.Throws<ArgumentException>(null, () => matrix.VectorTransformPoints([])); 806AssertExtensions.Throws<ArgumentException>(null, () => matrix.TransformVectors(new Point[0])); 807AssertExtensions.Throws<ArgumentException>(null, () => matrix.TransformVectors(new PointF[0])); 815AssertExtensions.Throws<ArgumentException>(null, () => disposedMatrix.VectorTransformPoints(new Point[1])); 816AssertExtensions.Throws<ArgumentException>(null, () => disposedMatrix.TransformPoints(new Point[1])); 817AssertExtensions.Throws<ArgumentException>(null, () => disposedMatrix.TransformVectors(new PointF[1]));
System\Drawing\Drawing2D\PathGradientBrushTests.cs (46)
69AssertExtensions.Throws<ArgumentNullException>("points", () => new PathGradientBrush((Point[])null)); 70AssertExtensions.Throws<ArgumentNullException>("points", () => new PathGradientBrush((PointF[])null)); 106AssertExtensions.Throws<ArgumentNullException>("path", () => new PathGradientBrush((GraphicsPath)null)); 134AssertExtensions.Throws<ArgumentException>(null, () => brush.Clone()); 154AssertExtensions.Throws<ArgumentException>(null, () => brush.CenterColor = Color.Blue); 192AssertExtensions.Throws<ArgumentException>(null, () => brush.SurroundColors = colors); 206AssertExtensions.Throws<ArgumentException>(null, () => brush.SurroundColors = colors); 213AssertExtensions.Throws<ArgumentNullException>(() => brush.SurroundColors = null); 240AssertExtensions.Throws<ArgumentException>(null, () => brush.CenterPoint); 292AssertExtensions.Throws<ArgumentException>(null, () => brush.Blend); 309AssertExtensions.Throws<ArgumentException>(null, () => brush.Blend = blend); 318AssertExtensions.Throws<ArgumentException>("value", null, () => brush.Blend = invalidBlend); 334AssertExtensions.Throws<ArgumentException, ArgumentNullException>("value", "source", () => 418AssertExtensions.Throws<ArgumentException>(null, () => brush.SetSigmaBellShape(1f)); 419AssertExtensions.Throws<ArgumentException>(null, () => brush.SetSigmaBellShape(1f, 1f)); 428AssertExtensions.Throws<ArgumentException>(null, null, () => brush.SetSigmaBellShape(focus)); 429AssertExtensions.Throws<ArgumentException>(null, null, () => brush.SetSigmaBellShape(focus, 1f)); 438AssertExtensions.Throws<ArgumentException>(null, null, () => brush.SetSigmaBellShape(1f, scale)); 502AssertExtensions.Throws<ArgumentException>(null, () => brush.SetBlendTriangularShape(1f)); 503AssertExtensions.Throws<ArgumentException>(null, () => brush.SetBlendTriangularShape(1f, 1f)); 512AssertExtensions.Throws<ArgumentException>(null, null, () => brush.SetBlendTriangularShape(focus)); 513AssertExtensions.Throws<ArgumentException>(null, null, () => brush.SetBlendTriangularShape(focus, 1f)); 522AssertExtensions.Throws<ArgumentException>(null, null, () => brush.SetBlendTriangularShape(1f, scale)); 568AssertExtensions.Throws<ArgumentException>(null, () => brush.InterpolationColors); 593AssertExtensions.Throws<ArgumentException, ArgumentNullException>("value", "source", () => 601AssertExtensions.Throws<ArgumentException>(null, () => brush.InterpolationColors = new ColorBlend()); 608AssertExtensions.Throws<ArgumentException>(null, () => 616AssertExtensions.Throws<ArgumentException, ArgumentException>("value", null, () => 654AssertExtensions.Throws<ArgumentException>(null, () => brush.Transform); 661AssertExtensions.Throws<ArgumentNullException>("value", "matrix", () => brush.Transform = null); 669AssertExtensions.Throws<ArgumentException>(null, () => brush.Transform = nonInvertible); 691AssertExtensions.Throws<ArgumentException>(null, () => brush.ResetTransform()); 725AssertExtensions.Throws<ArgumentException>(null, () => brush.MultiplyTransform(matrix, MatrixOrder.Append)); 732AssertExtensions.Throws<ArgumentNullException>("matrix", () => brush.MultiplyTransform(null)); 733AssertExtensions.Throws<ArgumentNullException>("matrix", () => brush.MultiplyTransform(null, MatrixOrder.Append)); 755AssertExtensions.Throws<ArgumentException>(null, () => brush.MultiplyTransform(matrix, (MatrixOrder)int.MinValue)); 763AssertExtensions.Throws<ArgumentException>(null, () => brush.MultiplyTransform(nonInvertible)); 764AssertExtensions.Throws<ArgumentException>(null, () => brush.MultiplyTransform(nonInvertible, MatrixOrder.Append)); 795AssertExtensions.Throws<ArgumentException>(null, () => brush.TranslateTransform(20f, 30f, MatrixOrder.Append)); 802AssertExtensions.Throws<ArgumentException>(null, () => brush.TranslateTransform(20f, 30f, (MatrixOrder)int.MinValue)); 845AssertExtensions.Throws<ArgumentException>(null, () => brush.ScaleTransform(0.25f, 2, MatrixOrder.Append)); 852AssertExtensions.Throws<ArgumentException>(null, () => brush.ScaleTransform(1, 1, (MatrixOrder)int.MinValue)); 886AssertExtensions.Throws<ArgumentException>(null, () => brush.RotateTransform(45, MatrixOrder.Append)); 893AssertExtensions.Throws<ArgumentException>(null, () => brush.RotateTransform(45, (MatrixOrder)int.MinValue)); 912AssertExtensions.Throws<ArgumentException>(null, () => brush.FocusScales); 930AssertExtensions.Throws<ArgumentException>(null, () => brush.WrapMode);
System\Drawing\FontConverterTests.cs (1)
63AssertExtensions.Throws<ArgumentException>(paramName, netfxParamName, () => converter.ConvertFrom(input));
System\Drawing\FontFamilyTests.cs (12)
49AssertExtensions.Throws<ArgumentException>(null, () => new FontFamily(name)); 50AssertExtensions.Throws<ArgumentException>(null, () => new FontFamily(name, null)); 56AssertExtensions.Throws<ArgumentNullException>("name", () => new FontFamily(null!)); 57AssertExtensions.Throws<ArgumentNullException>("name", () => new FontFamily(null!, null)); 64AssertExtensions.Throws<ArgumentException>(null, () => new FontFamily("Times New Roman", fontCollection)); 150AssertExtensions.Throws<ArgumentNullException>("graphics", () => FontFamily.GetFamilies(null)); 196AssertExtensions.Throws<ArgumentException>(null, () => family.IsStyleAvailable(FontStyle.Italic)); 208AssertExtensions.Throws<ArgumentException>(null, () => family.GetEmHeight(FontStyle.Italic)); 237AssertExtensions.Throws<ArgumentException>(null, () => family.GetName(0)); 249AssertExtensions.Throws<ArgumentException>(null, () => family.GetCellAscent(FontStyle.Italic)); 261AssertExtensions.Throws<ArgumentException>(null, () => family.GetCellDescent(FontStyle.Italic)); 273AssertExtensions.Throws<ArgumentException>(null, () => family.GetLineSpacing(FontStyle.Italic));
System\Drawing\FontTests.cs (50)
326AssertExtensions.Throws<ArgumentNullException>("family", () => new Font((FontFamily)null, 10)); 327AssertExtensions.Throws<ArgumentNullException>("family", () => new Font((FontFamily)null, 10, FontStyle.Italic)); 328AssertExtensions.Throws<ArgumentNullException>("family", () => new Font((FontFamily)null, 10, GraphicsUnit.Display)); 329AssertExtensions.Throws<ArgumentNullException>("family", () => new Font((FontFamily)null, 10, FontStyle.Italic, GraphicsUnit.Display)); 330AssertExtensions.Throws<ArgumentNullException>("family", () => new Font((FontFamily)null, 10, FontStyle.Italic, GraphicsUnit.Display, 10)); 331AssertExtensions.Throws<ArgumentNullException>("family", () => new Font((FontFamily)null, 10, FontStyle.Italic, GraphicsUnit.Display, 10, gdiVerticalFont: true)); 343AssertExtensions.Throws<ArgumentException>(null, () => new Font(family, 10)); 344AssertExtensions.Throws<ArgumentException>(null, () => new Font(family, 10, FontStyle.Italic)); 345AssertExtensions.Throws<ArgumentException>(null, () => new Font(family, 10, GraphicsUnit.Display)); 346AssertExtensions.Throws<ArgumentException>(null, () => new Font(family, 10, FontStyle.Italic, GraphicsUnit.Display)); 347AssertExtensions.Throws<ArgumentException>(null, () => new Font(family, 10, FontStyle.Italic, GraphicsUnit.Display, 10)); 348AssertExtensions.Throws<ArgumentException>(null, () => new Font(family, 10, FontStyle.Italic, GraphicsUnit.Display, 10, gdiVerticalFont: true)); 360AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family, emSize)); 361AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family.Name, emSize)); 362AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family, emSize, FontStyle.Italic)); 363AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family.Name, emSize, FontStyle.Italic)); 364AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family, emSize, GraphicsUnit.Document)); 365AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family.Name, emSize, GraphicsUnit.Document)); 366AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family, emSize, FontStyle.Italic, GraphicsUnit.Document)); 367AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family.Name, emSize, FontStyle.Italic, GraphicsUnit.Document)); 368AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family, emSize, FontStyle.Italic, GraphicsUnit.Document, 10)); 369AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family.Name, emSize, FontStyle.Italic, GraphicsUnit.Document, 10)); 370AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family, emSize, FontStyle.Italic, GraphicsUnit.Document, 10, gdiVerticalFont: true)); 371AssertExtensions.Throws<ArgumentException>("emSize", () => new Font(family.Name, emSize, FontStyle.Italic, GraphicsUnit.Document, 10, gdiVerticalFont: true)); 381AssertExtensions.Throws<ArgumentException>(null, () => new Font(family, 10, unit)); 382AssertExtensions.Throws<ArgumentException>(null, () => new Font(family.Name, 10, unit)); 383AssertExtensions.Throws<ArgumentException>(null, () => new Font(family, 10, FontStyle.Italic, unit)); 384AssertExtensions.Throws<ArgumentException>(null, () => new Font(family.Name, 10, FontStyle.Italic, unit)); 385AssertExtensions.Throws<ArgumentException>(null, () => new Font(family, 10, FontStyle.Italic, unit, 10)); 386AssertExtensions.Throws<ArgumentException>(null, () => new Font(family.Name, 10, FontStyle.Italic, unit, 10)); 387AssertExtensions.Throws<ArgumentException>(null, () => new Font(family, 10, FontStyle.Italic, unit, 10, gdiVerticalFont: true)); 388AssertExtensions.Throws<ArgumentException>(null, () => new Font(family.Name, 10, FontStyle.Italic, unit, 10, gdiVerticalFont: true)); 414AssertExtensions.Throws<ArgumentException>(null, () => font.Clone()); 461AssertExtensions.Throws<ArgumentException>(null, () => Font.FromHdc(IntPtr.Zero)); 472AssertExtensions.Throws<ArgumentException>(null, () => Font.FromHdc(hdc)); 483AssertExtensions.Throws<ArgumentException>(null, () => Font.FromHfont(IntPtr.Zero)); 492AssertExtensions.GreaterThan(height, 0); 526AssertExtensions.Throws<ArgumentNullException>("graphics", () => font.GetHeight(null)); 538AssertExtensions.Throws<ArgumentException>("graphics", () => font.GetHeight(graphics)); 550AssertExtensions.Throws<ArgumentException>(null, () => font.GetHeight()); 551AssertExtensions.Throws<ArgumentException>(null, () => font.GetHeight(10)); 552AssertExtensions.Throws<ArgumentException>(null, () => font.GetHeight(graphics)); 598AssertExtensions.Throws<ArgumentException>(null, () => Font.FromLogFont(null)); 599AssertExtensions.Throws<ArgumentException>(null, () => Font.FromLogFont(null, hdc)); 603AssertExtensions.Throws<ArgumentNullException>("lf", () => Font.FromLogFont(null)); 604AssertExtensions.Throws<ArgumentNullException>("lf", () => Font.FromLogFont(null, hdc)); 622AssertExtensions.Throws<ArgumentException>(null, () => Font.FromLogFont(logFont)); 623AssertExtensions.Throws<ArgumentException>(null, () => Font.FromLogFont(logFont, hdc)); 775AssertExtensions.Throws<ArgumentNullException>("graphics", () => font.ToLogFont(new LOGFONT(), null)); 845AssertExtensions.Throws<ArgumentException>(null, () => font.ToHfont());
System\Drawing\Graphics_DrawBezierTests.cs (20)
65AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawBezier(null, 1, 2, 3, 4, 5, 6, 7, 8)); 66AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawBezier(null, Point.Empty, Point.Empty, Point.Empty, Point.Empty)); 67AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawBezier(null, PointF.Empty, PointF.Empty, PointF.Empty, PointF.Empty)); 78AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawBezier(pen, 1, 2, 3, 4, 5, 6, 7, 8)); 79AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawBezier(pen, Point.Empty, Point.Empty, Point.Empty, Point.Empty)); 80AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawBezier(pen, PointF.Empty, PointF.Empty, PointF.Empty, PointF.Empty)); 110AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawArc(pen, new Rectangle(0, 0, 1, 1), 0, 90)); 111AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawArc(pen, 0, 0, 1, 1, 0, 90)); 112AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawArc(pen, new RectangleF(0, 0, 1, 1), 0, 90)); 113AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawArc(pen, 0f, 0f, 1f, 1f, 0, 90)); 121AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawBeziers(null, new Point[2])); 122AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawBeziers(null, new PointF[2])); 133AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawBeziers(pen, new Point[2])); 134AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawBeziers(pen, new PointF[2])); 143AssertExtensions.Throws<ArgumentNullException>("points", () => graphics.DrawBeziers(pen, (Point[])null)); 144AssertExtensions.Throws<ArgumentNullException>("points", () => graphics.DrawBeziers(pen, (PointF[])null)); 153AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawBeziers(pen, new Point[0])); 154AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawBeziers(pen, new PointF[0])); 183AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawBeziers(pen, new Point[2])); 184AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawBeziers(pen, new PointF[2]));
System\Drawing\Graphics_DrawLineTests.cs (22)
43AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawLine(null, Point.Empty, Point.Empty)); 44AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawLine(null, 0, 0, 0, 0)); 45AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawLine(null, PointF.Empty, PointF.Empty)); 46AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawLine(null, 0f, 0f, 0f, 0f)); 57AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawLine(pen, Point.Empty, Point.Empty)); 58AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawLine(pen, 0, 0, 0, 0)); 59AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawLine(pen, PointF.Empty, PointF.Empty)); 60AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawLine(pen, 0f, 0f, 0f, 0f)); 91AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawLine(pen, Point.Empty, Point.Empty)); 92AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawLine(pen, 0, 0, 0, 0)); 93AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawLine(pen, PointF.Empty, PointF.Empty)); 94AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawLine(pen, 0f, 0f, 0f, 0f)); 102AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawLines(null, new Point[2])); 103AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawLines(null, new PointF[2])); 114AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawLines(pen, new Point[2])); 115AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawLines(pen, new PointF[2])); 124AssertExtensions.Throws<ArgumentNullException>("points", () => graphics.DrawLines(pen, (Point[])null)); 125AssertExtensions.Throws<ArgumentNullException>("points", () => graphics.DrawLines(pen, (PointF[])null)); 136AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawLines(pen, new Point[length])); 137AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawLines(pen, new PointF[length])); 166AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawLines(pen, new Point[2])); 167AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawLines(pen, new PointF[2]));
System\Drawing\GraphicsTests.Core.cs (11)
19AssertExtensions.Throws<ArgumentException>(null, () => graphics.TransformElements = matrix); 46AssertExtensions.Throws<ArgumentException>(null, () => graphics.TransformElements); 47AssertExtensions.Throws<ArgumentException>(null, () => graphics.TransformElements = Matrix3x2.Identity); 75AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawRectangle(null, new RectangleF(0f, 0f, 1f, 1f))); 88AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawRectangle(pen, new RectangleF(0f, 0f, 1f, 1f))); 119AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawRectangle(pen, new RectangleF(0f, 0f, 1f, 1f))); 129AssertExtensions.Throws<ArgumentNullException>("brush", () => graphics.FillPie(null, new RectangleF(0, 0, 1, 1), 0, 90)); 142AssertExtensions.Throws<ArgumentException>(null, () => graphics.FillPie(brush, new RectangleF(0, 0, 1, 1), 0, 90)); 153AssertExtensions.Throws<ArgumentException>(null, () => graphics.FillPie(brush, new RectangleF(0, 0, 0, 1), 0, 90)); 164AssertExtensions.Throws<ArgumentException>(null, () => graphics.FillPie(brush, new RectangleF(0, 0, 1, 0), 0, 90)); 195AssertExtensions.Throws<ArgumentException>(null, () => graphics.FillPie(brush, new RectangleF(0, 0, 1, 1), 0, 90));
System\Drawing\GraphicsTests.cs (257)
77AssertExtensions.Throws<ArgumentException>(null, () => graphics.GetHdc()); 110AssertExtensions.Throws<ArgumentNullException>("hdc", () => Graphics.FromHdc(IntPtr.Zero)); 139AssertExtensions.Throws<ArgumentException>(null, () => graphics.ReleaseHdc(hdc)); 140AssertExtensions.Throws<ArgumentException>(null, () => graphics.ReleaseHdcInternal(hdc)); 144AssertExtensions.Throws<ArgumentException>(null, () => graphics.ReleaseHdc()); 145AssertExtensions.Throws<ArgumentException>(null, () => graphics.ReleaseHdcInternal(hdc)); 149AssertExtensions.Throws<ArgumentException>(null, () => graphics.ReleaseHdc()); 150AssertExtensions.Throws<ArgumentException>(null, () => graphics.ReleaseHdcInternal(hdc)); 160AssertExtensions.Throws<ArgumentException>(null, () => graphics.ReleaseHdcInternal(10)); 164AssertExtensions.Throws<ArgumentException>(null, () => graphics.ReleaseHdc(10)); 179AssertExtensions.Throws<ArgumentException>(null, () => graphics1.ReleaseHdc(hdc1)); 182AssertExtensions.Throws<ArgumentException>(null, () => graphics2.ReleaseHdc(hdc2)); 190AssertExtensions.Throws<ArgumentException>(null, () => graphics.ReleaseHdc()); 191AssertExtensions.Throws<ArgumentException>(null, () => graphics.ReleaseHdc(IntPtr.Zero)); 192AssertExtensions.Throws<ArgumentException>(null, () => graphics.ReleaseHdcInternal(IntPtr.Zero)); 202AssertExtensions.Throws<ArgumentException>(null, () => graphics.ReleaseHdc()); 203AssertExtensions.Throws<ArgumentException>(null, () => graphics.ReleaseHdc(IntPtr.Zero)); 204AssertExtensions.Throws<ArgumentException>(null, () => graphics.ReleaseHdcInternal(IntPtr.Zero)); 258AssertExtensions.Throws<ArgumentNullException>("image", () => Graphics.FromImage(null)); 268Exception exception = AssertExtensions.Throws<ArgumentException, Exception>(() => Graphics.FromImage(image)); 279AssertExtensions.Throws<ArgumentException>(null, () => Graphics.FromImage(image)); 339AssertExtensions.Throws<InvalidEnumArgumentException>("value", () => graphics.CompositingMode = compositingMode); 366AssertExtensions.Throws<ArgumentException>(null, () => graphics.CompositingMode); 367AssertExtensions.Throws<ArgumentException>(null, () => graphics.CompositingMode = CompositingMode.SourceCopy); 423AssertExtensions.Throws<InvalidEnumArgumentException>("value", () => graphics.CompositingQuality = compositingQuality); 450AssertExtensions.Throws<ArgumentException>(null, () => graphics.CompositingQuality); 451AssertExtensions.Throws<ArgumentException>(null, () => graphics.CompositingQuality = CompositingQuality.AssumeLinear); 503AssertExtensions.Throws<ArgumentException>(null, () => graphics.DpiX); 529AssertExtensions.Throws<ArgumentException>(null, () => graphics.DpiX); 575AssertExtensions.Throws<ArgumentException>(null, () => graphics.Flush()); 576AssertExtensions.Throws<ArgumentException>(null, () => graphics.Flush(FlushIntention.Flush)); 603AssertExtensions.Throws<InvalidEnumArgumentException>("value", () => graphics.InterpolationMode = interpolationMode); 611AssertExtensions.Throws<ArgumentException>(null, () => graphics.InterpolationMode = InterpolationMode.Invalid); 638AssertExtensions.Throws<ArgumentException>(null, () => graphics.InterpolationMode); 639AssertExtensions.Throws<ArgumentException>(null, () => graphics.InterpolationMode = InterpolationMode.HighQualityBilinear); 664AssertExtensions.Throws<ArgumentException>(null, () => graphics.PageScale = pageScale); 691AssertExtensions.Throws<ArgumentException>(null, () => graphics.PageScale); 692AssertExtensions.Throws<ArgumentException>(null, () => graphics.PageScale = 10); 717AssertExtensions.Throws<InvalidEnumArgumentException>("value", () => graphics.PageUnit = pageUnit); 725AssertExtensions.Throws<ArgumentException>(null, () => graphics.PageUnit = GraphicsUnit.World); 752AssertExtensions.Throws<ArgumentException>(null, () => graphics.PageUnit); 753AssertExtensions.Throws<ArgumentException>(null, () => graphics.PageUnit = GraphicsUnit.Document); 777AssertExtensions.Throws<InvalidEnumArgumentException>("value", () => graphics.PixelOffsetMode = pixelOffsetMode); 785AssertExtensions.Throws<ArgumentException>(null, () => graphics.PixelOffsetMode = PixelOffsetMode.Invalid); 812AssertExtensions.Throws<ArgumentException>(null, () => graphics.PixelOffsetMode); 813AssertExtensions.Throws<ArgumentException>(null, () => graphics.PixelOffsetMode = PixelOffsetMode.Default); 894AssertExtensions.Throws<ArgumentException>(null, () => graphics.RenderingOrigin); 895AssertExtensions.Throws<ArgumentException>(null, () => graphics.RenderingOrigin = Point.Empty); 919AssertExtensions.Throws<InvalidEnumArgumentException>("value", () => graphics.SmoothingMode = smoothingMode); 927AssertExtensions.Throws<ArgumentException>(null, () => graphics.SmoothingMode = SmoothingMode.Invalid); 954AssertExtensions.Throws<ArgumentException>(null, () => graphics.SmoothingMode); 955AssertExtensions.Throws<ArgumentException>(null, () => graphics.SmoothingMode = SmoothingMode.AntiAlias); 977AssertExtensions.Throws<ArgumentException>(null, () => graphics.TextContrast = textContrast); 1004AssertExtensions.Throws<ArgumentException>(null, () => graphics.TextContrast); 1005AssertExtensions.Throws<ArgumentException>(null, () => graphics.TextContrast = 5); 1030AssertExtensions.Throws<InvalidEnumArgumentException>("value", () => graphics.TextRenderingHint = textRenderingHint); 1057AssertExtensions.Throws<ArgumentException>(null, () => graphics.TextRenderingHint); 1058AssertExtensions.Throws<ArgumentException>(null, () => graphics.TextRenderingHint = TextRenderingHint.SingleBitPerPixelGridFit); 1103AssertExtensions.Throws<ArgumentException>(null, () => graphics.Transform = matrix); 1112AssertExtensions.Throws<ArgumentException>(null, () => graphics.Transform = matrix); 1141AssertExtensions.Throws<ArgumentException>(null, () => graphics.Transform); 1142AssertExtensions.Throws<ArgumentException>(null, () => graphics.Transform = matrix); 1181AssertExtensions.Throws<ArgumentException>(null, () => graphics.ResetTransform()); 1221AssertExtensions.Throws<ArgumentNullException>("matrix", () => graphics.MultiplyTransform(null)); 1222AssertExtensions.Throws<ArgumentNullException>("matrix", () => graphics.MultiplyTransform(null, MatrixOrder.Append)); 1246AssertExtensions.Throws<ArgumentException>(null, () => graphics.MultiplyTransform(matrix)); 1247AssertExtensions.Throws<ArgumentException>(null, () => graphics.MultiplyTransform(matrix, MatrixOrder.Append)); 1258AssertExtensions.Throws<ArgumentException>(null, () => graphics.MultiplyTransform(matrix, order)); 1287AssertExtensions.Throws<ArgumentException>(null, () => graphics.MultiplyTransform(matrix)); 1288AssertExtensions.Throws<ArgumentException>(null, () => graphics.MultiplyTransform(matrix, MatrixOrder.Prepend)); 1335AssertExtensions.Throws<ArgumentException>(null, () => graphics.TranslateTransform(0, 0, order)); 1362AssertExtensions.Throws<ArgumentException>(null, () => graphics.TranslateTransform(0, 0)); 1363AssertExtensions.Throws<ArgumentException>(null, () => graphics.TranslateTransform(0, 0, MatrixOrder.Append)); 1405AssertExtensions.Throws<ArgumentException>(null, () => graphics.ScaleTransform(0, 0)); 1406AssertExtensions.Throws<ArgumentException>(null, () => graphics.ScaleTransform(0, 0, MatrixOrder.Append)); 1416AssertExtensions.Throws<ArgumentException>(null, () => graphics.ScaleTransform(0, 0, order)); 1443AssertExtensions.Throws<ArgumentException>(null, () => graphics.ScaleTransform(0, 0)); 1444AssertExtensions.Throws<ArgumentException>(null, () => graphics.ScaleTransform(0, 0, MatrixOrder.Append)); 1492AssertExtensions.Throws<ArgumentException>(null, () => graphics.RotateTransform(0, order)); 1519AssertExtensions.Throws<ArgumentException>(null, () => graphics.RotateTransform(0)); 1520AssertExtensions.Throws<ArgumentException>(null, () => graphics.RotateTransform(0, MatrixOrder.Append)); 1678AssertExtensions.Throws<ArgumentException>(null, () => graphics.CopyFromScreen(0, 0, 0, 0, Size.Empty)); 1679AssertExtensions.Throws<ArgumentException>(null, () => graphics.CopyFromScreen(0, 0, 0, 0, Size.Empty, CopyPixelOperation.MergeCopy)); 1680AssertExtensions.Throws<ArgumentException>(null, () => graphics.CopyFromScreen(Point.Empty, Point.Empty, Size.Empty)); 1681AssertExtensions.Throws<ArgumentException>(null, () => graphics.CopyFromScreen(Point.Empty, Point.Empty, Size.Empty, CopyPixelOperation.MergeCopy)); 1853AssertExtensions.Throws<ArgumentException>(null, () => graphics.TransformPoints(destSpace, CoordinateSpace.World, new Point[] { new(1, 1) })); 1854AssertExtensions.Throws<ArgumentException>(null, () => graphics.TransformPoints(destSpace, CoordinateSpace.World, new PointF[] { new(1, 1) })); 1864AssertExtensions.Throws<ArgumentException>(null, () => graphics.TransformPoints(CoordinateSpace.World, srcSpace, new Point[] { new(1, 1) })); 1865AssertExtensions.Throws<ArgumentException>(null, () => graphics.TransformPoints(CoordinateSpace.World, srcSpace, new PointF[] { new(1, 1) })); 1873AssertExtensions.Throws<ArgumentNullException>("pts", () => graphics.TransformPoints(CoordinateSpace.Page, CoordinateSpace.Page, (Point[])null)); 1874AssertExtensions.Throws<ArgumentNullException>("pts", () => graphics.TransformPoints(CoordinateSpace.Page, CoordinateSpace.Page, (PointF[])null)); 1882AssertExtensions.Throws<ArgumentException>(null, () => graphics.TransformPoints(CoordinateSpace.Page, CoordinateSpace.Page, new Point[0])); 1883AssertExtensions.Throws<ArgumentException>(null, () => graphics.TransformPoints(CoordinateSpace.Page, CoordinateSpace.Page, new PointF[0])); 1910AssertExtensions.Throws<ArgumentException>(null, () => graphics.TransformPoints(CoordinateSpace.Page, CoordinateSpace.Page, new Point[] { Point.Empty })); 1911AssertExtensions.Throws<ArgumentException>(null, () => graphics.TransformPoints(CoordinateSpace.Page, CoordinateSpace.Page, new PointF[] { PointF.Empty })); 1952AssertExtensions.Throws<ArgumentException>(null, () => graphics.GetNearestColor(Color.Red)); 1960AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawArc(null, new Rectangle(0, 0, 1, 1), 0, 90)); 1961AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawArc(null, 0, 0, 1, 1, 0, 90)); 1962AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawArc(null, new RectangleF(0, 0, 1, 1), 0, 90)); 1963AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawArc(null, 0f, 0f, 1f, 1f, 0, 90)); 1974AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawArc(pen, new Rectangle(0, 0, 1, 1), 0, 90)); 1975AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawArc(pen, 0, 0, 1, 1, 0, 90)); 1976AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawArc(pen, new RectangleF(0, 0, 1, 1), 0, 90)); 1977AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawArc(pen, 0f, 0f, 1f, 1f, 0, 90)); 1986AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawArc(pen, new Rectangle(0, 0, 0, 1), 0, 90)); 1987AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawArc(pen, 0, 0, 0, 1, 0, 90)); 1988AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawArc(pen, new RectangleF(0, 0, 0, 1), 0, 90)); 1989AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawArc(pen, 0f, 0f, 0f, 1f, 0, 90)); 1998AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawArc(pen, new Rectangle(0, 0, 1, 0), 0, 90)); 1999AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawArc(pen, 0, 0, 1, 0, 0, 90)); 2000AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawArc(pen, new RectangleF(0, 0, 1, 0), 0, 90)); 2001AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawArc(pen, 0f, 0f, 1f, 0f, 0, 90)); 2032AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawArc(pen, new Rectangle(0, 0, 1, 1), 0, 90)); 2033AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawArc(pen, 0, 0, 1, 1, 0, 90)); 2034AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawArc(pen, new RectangleF(0, 0, 1, 1), 0, 90)); 2035AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawArc(pen, 0f, 0f, 1f, 1f, 0, 90)); 2043AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawRectangle(null, new Rectangle(0, 0, 1, 1))); 2044AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawRectangle(null, 0, 0, 1, 1)); 2045AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawRectangle(null, 0f, 0f, 1f, 1f)); 2056AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawRectangle(pen, new Rectangle(0, 0, 1, 1))); 2057AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawRectangle(pen, 0, 0, 1, 1)); 2058AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawRectangle(pen, 0f, 0f, 1f, 1f)); 2088AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawRectangle(pen, new Rectangle(0, 0, 1, 1))); 2089AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawRectangle(pen, 0, 0, 1, 1)); 2090AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawRectangle(pen, 0f, 0f, 1f, 1f)); 2098AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawRectangles(null, new Rectangle[2])); 2099AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawRectangles(null, new RectangleF[2])); 2110AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawRectangles(pen, new Rectangle[2])); 2111AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawRectangles(pen, new RectangleF[2])); 2120AssertExtensions.Throws<ArgumentNullException>("rects", () => graphics.DrawRectangles(pen, (Rectangle[])null)); 2121AssertExtensions.Throws<ArgumentNullException>("rects", () => graphics.DrawRectangles(pen, (RectangleF[])null)); 2130AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawRectangles(pen, new Rectangle[0])); 2131AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawRectangles(pen, new RectangleF[0])); 2160AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawRectangles(pen, new Rectangle[2])); 2161AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawRectangles(pen, new RectangleF[2])); 2169AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawEllipse(null, new Rectangle(0, 0, 1, 1))); 2170AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawEllipse(null, 0, 0, 1, 1)); 2171AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawEllipse(null, new RectangleF(0, 0, 1, 1))); 2172AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawEllipse(null, 0f, 0f, 1f, 1f)); 2183AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawEllipse(pen, new Rectangle(0, 0, 1, 1))); 2184AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawEllipse(pen, 0, 0, 1, 1)); 2185AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawEllipse(pen, new RectangleF(0, 0, 1, 1))); 2186AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawEllipse(pen, 0f, 0f, 1f, 1f)); 2217AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawEllipse(pen, new Rectangle(0, 0, 1, 1))); 2218AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawEllipse(pen, 0, 0, 1, 1)); 2219AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawEllipse(pen, new RectangleF(0, 0, 1, 1))); 2220AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawEllipse(pen, 0f, 0f, 1f, 1f)); 2228AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawPie(null, new Rectangle(0, 0, 1, 1), 0, 90)); 2229AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawPie(null, 0, 0, 1, 1, 0, 90)); 2230AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawPie(null, new RectangleF(0, 0, 1, 1), 0, 90)); 2231AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawPie(null, 0f, 0f, 1f, 1f, 0, 90)); 2242AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawPie(pen, new Rectangle(0, 0, 1, 1), 0, 90)); 2243AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawPie(pen, 0, 0, 1, 1, 0, 90)); 2244AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawPie(pen, new RectangleF(0, 0, 1, 1), 0, 90)); 2245AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawPie(pen, 0f, 0f, 1f, 1f, 0, 90)); 2254AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawPie(pen, new Rectangle(0, 0, 0, 1), 0, 90)); 2255AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawPie(pen, 0, 0, 0, 1, 0, 90)); 2256AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawPie(pen, new RectangleF(0, 0, 0, 1), 0, 90)); 2257AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawPie(pen, 0f, 0f, 0f, 1f, 0, 90)); 2266AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawArc(pen, new Rectangle(0, 0, 1, 0), 0, 90)); 2267AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawArc(pen, 0, 0, 1, 0, 0, 90)); 2268AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawArc(pen, new RectangleF(0, 0, 1, 0), 0, 90)); 2269AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawArc(pen, 0f, 0f, 1f, 0f, 0, 90)); 2300AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawPie(pen, new Rectangle(0, 0, 1, 1), 0, 90)); 2301AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawPie(pen, 0, 0, 1, 1, 0, 90)); 2302AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawPie(pen, new RectangleF(0, 0, 1, 1), 0, 90)); 2303AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawPie(pen, 0f, 0f, 1f, 1f, 0, 90)); 2311AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawPolygon(null, new Point[2])); 2312AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawPolygon(null, new PointF[2])); 2323AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawPolygon(pen, new Point[2])); 2324AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawPolygon(pen, new PointF[2])); 2333AssertExtensions.Throws<ArgumentNullException>("points", () => graphics.DrawPolygon(pen, (Point[])null)); 2334AssertExtensions.Throws<ArgumentNullException>("points", () => graphics.DrawPolygon(pen, (PointF[])null)); 2345AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawPolygon(pen, new Point[length])); 2346AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawPolygon(pen, new PointF[length])); 2375AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawPolygon(pen, new Point[2])); 2376AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawPolygon(pen, new PointF[2])); 2385AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawPath(null, graphicsPath)); 2397AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawPath(pen, graphicsPath)); 2406AssertExtensions.Throws<ArgumentNullException>("path", () => graphics.DrawPath(pen, null)); 2418AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawPath(pen, graphicsPath)); 2448AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawPath(pen, graphicsPath)); 2456AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawCurve(null, new Point[2])); 2457AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawCurve(null, new PointF[2])); 2458AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawCurve(null, new Point[2], 1)); 2459AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawCurve(null, new PointF[2], 1)); 2460AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawCurve(null, new PointF[2], 0, 2)); 2461AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawCurve(null, new Point[2], 0, 2, 1)); 2462AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawCurve(null, new PointF[2], 0, 2, 1)); 2473AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawCurve(pen, new Point[2])); 2474AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawCurve(pen, new PointF[2])); 2475AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawCurve(pen, new Point[2], 1)); 2476AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawCurve(pen, new PointF[2], 1)); 2477AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawCurve(pen, new PointF[2], 0, 2)); 2478AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawCurve(pen, new Point[2], 0, 2, 1)); 2479AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawCurve(pen, new PointF[2], 0, 2, 1)); 2488AssertExtensions.Throws<ArgumentNullException>("points", () => graphics.DrawCurve(pen, (Point[])null)); 2489AssertExtensions.Throws<ArgumentNullException>("points", () => graphics.DrawCurve(pen, (PointF[])null)); 2490AssertExtensions.Throws<ArgumentNullException>("points", () => graphics.DrawCurve(pen, (Point[])null, 1)); 2491AssertExtensions.Throws<ArgumentNullException>("points", () => graphics.DrawCurve(pen, (PointF[])null, 1)); 2492AssertExtensions.Throws<ArgumentNullException>("points", () => graphics.DrawCurve(pen, null, 0, 2)); 2493AssertExtensions.Throws<ArgumentNullException>("points", () => graphics.DrawCurve(pen, (Point[])null, 0, 2, 1)); 2494AssertExtensions.Throws<ArgumentNullException>("points", () => graphics.DrawCurve(pen, (PointF[])null, 0, 2, 1)); 2505AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawCurve(pen, new Point[length])); 2506AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawCurve(pen, new PointF[length])); 2507AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawCurve(pen, new Point[length], 1)); 2508AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawCurve(pen, new PointF[length], 1)); 2509AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawCurve(pen, new PointF[length], 0, length)); 2510AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawCurve(pen, new Point[length], 0, length, 1)); 2511AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawCurve(pen, new PointF[length], 0, length, 1)); 2525AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawCurve(pen, new PointF[length], offset, numberOfSegments)); 2526AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawCurve(pen, new Point[length], offset, numberOfSegments, 1)); 2527AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawCurve(pen, new PointF[length], offset, numberOfSegments, 1)); 2561AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawCurve(pen, new Point[2])); 2562AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawCurve(pen, new PointF[2])); 2563AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawCurve(pen, new Point[2], 1)); 2564AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawCurve(pen, new PointF[2], 1)); 2565AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawCurve(pen, new PointF[2], 0, 2)); 2566AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawCurve(pen, new Point[2], 0, 2, 1)); 2567AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawCurve(pen, new PointF[2], 0, 2, 1)); 2575AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawClosedCurve(null, new Point[3])); 2576AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawClosedCurve(null, new Point[3], 1, FillMode.Winding)); 2577AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawClosedCurve(null, new PointF[3])); 2578AssertExtensions.Throws<ArgumentNullException>("pen", () => graphics.DrawClosedCurve(null, new PointF[3], 1, FillMode.Winding)); 2589AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawClosedCurve(pen, new Point[3])); 2590AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawClosedCurve(pen, new Point[3], 1, FillMode.Winding)); 2591AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawClosedCurve(pen, new PointF[3])); 2592AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawClosedCurve(pen, new PointF[3], 1, FillMode.Winding)); 2601AssertExtensions.Throws<ArgumentNullException>("points", () => graphics.DrawClosedCurve(pen, (Point[])null)); 2602AssertExtensions.Throws<ArgumentNullException>("points", () => graphics.DrawClosedCurve(pen, (Point[])null, 1, FillMode.Winding)); 2603AssertExtensions.Throws<ArgumentNullException>("points", () => graphics.DrawClosedCurve(pen, (PointF[])null)); 2604AssertExtensions.Throws<ArgumentNullException>("points", () => graphics.DrawClosedCurve(pen, (PointF[])null, 1, FillMode.Winding)); 2616AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawClosedCurve(pen, new Point[length])); 2617AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawClosedCurve(pen, new Point[length], 1, FillMode.Winding)); 2618AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawClosedCurve(pen, new PointF[length])); 2619AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawClosedCurve(pen, new PointF[length], 1, FillMode.Winding)); 2650AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawClosedCurve(pen, new Point[3])); 2651AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawClosedCurve(pen, new Point[3], 1, FillMode.Alternate)); 2652AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawClosedCurve(pen, new PointF[3])); 2653AssertExtensions.Throws<ArgumentException>(null, () => graphics.DrawClosedCurve(pen, new PointF[3], 1, FillMode.Alternate)); 2661AssertExtensions.Throws<ArgumentNullException>("brush", () => graphics.FillPie(null, new Rectangle(0, 0, 1, 1), 0, 90)); 2662AssertExtensions.Throws<ArgumentNullException>("brush", () => graphics.FillPie(null, 0, 0, 1, 1, 0, 90)); 2663AssertExtensions.Throws<ArgumentNullException>("brush", () => graphics.FillPie(null, 0f, 0f, 1f, 1f, 0, 90)); 2674AssertExtensions.Throws<ArgumentException>(null, () => graphics.FillPie(brush, new Rectangle(0, 0, 1, 1), 0, 90)); 2675AssertExtensions.Throws<ArgumentException>(null, () => graphics.FillPie(brush, 0, 0, 1, 1, 0, 90)); 2676AssertExtensions.Throws<ArgumentException>(null, () => graphics.FillPie(brush, 0f, 0f, 1f, 1f, 0, 90)); 2685AssertExtensions.Throws<ArgumentException>(null, () => graphics.FillPie(brush, new Rectangle(0, 0, 0, 1), 0, 90)); 2686AssertExtensions.Throws<ArgumentException>(null, () => graphics.FillPie(brush, 0, 0, 0, 1, 0, 90)); 2687AssertExtensions.Throws<ArgumentException>(null, () => graphics.FillPie(brush, 0f, 0f, 0f, 1f, 0, 90)); 2696AssertExtensions.Throws<ArgumentException>(null, () => graphics.FillPie(brush, new Rectangle(0, 0, 1, 0), 0, 90)); 2697AssertExtensions.Throws<ArgumentException>(null, () => graphics.FillPie(brush, 0, 0, 1, 0, 0, 90)); 2698AssertExtensions.Throws<ArgumentException>(null, () => graphics.FillPie(brush, 0f, 0f, 1f, 0f, 0, 90)); 2728AssertExtensions.Throws<ArgumentException>(null, () => graphics.FillPie(brush, new Rectangle(0, 0, 1, 1), 0, 90)); 2729AssertExtensions.Throws<ArgumentException>(null, () => graphics.FillPie(brush, 0, 0, 1, 1, 0, 90)); 2730AssertExtensions.Throws<ArgumentException>(null, () => graphics.FillPie(brush, 0f, 0f, 1f, 1f, 0, 90)); 2776AssertExtensions.Throws<ArgumentException>(null, () => graphics.Clear(Color.Red)); 2794AssertExtensions.Throws<ArgumentException>(
System\Drawing\IconTests.cs (15)
89AssertExtensions.Throws<ArgumentNullException>("path", () => new Icon((string)null)); 90AssertExtensions.Throws<ArgumentNullException>("path", () => new Icon((string)null, new Size(32, 32))); 91AssertExtensions.Throws<ArgumentNullException>("path", () => new Icon((string)null, 32, 32)); 145AssertExtensions.Throws<ArgumentNullException, ArgumentException>("stream", null, () => new Icon((Stream)null)); 146AssertExtensions.Throws<ArgumentNullException, ArgumentException>("stream", null, () => new Icon((Stream)null, 32, 32)); 147AssertExtensions.Throws<ArgumentNullException, ArgumentException>("stream", null, () => new Icon((Stream)null, new Size(32, 32))); 245AssertExtensions.Throws<ArgumentNullException, ArgumentException>("original", null, () => new Icon((Icon)null, 32, 32)); 246AssertExtensions.Throws<ArgumentNullException, ArgumentException>("original", null, () => new Icon((Icon)null, new Size(32, 32))); 269AssertExtensions.Throws<ArgumentException>(null, () => new Icon(type, resource)); 275AssertExtensions.Throws<ArgumentNullException, ArgumentException>("resource", null, () => new Icon(typeof(Icon), null)); 401AssertExtensions.Throws<ArgumentNullException, ArgumentException>("filePath", null, () => Icon.ExtractAssociatedIcon(null)); 407AssertExtensions.Throws<ArgumentException>("filePath", null, () => Icon.ExtractAssociatedIcon("")); 463AssertExtensions.Throws<ArgumentNullException>("outputStream", "dataStream", () => icon.Save(null)); 592AssertExtensions.Throws<ArgumentOutOfRangeException>(null, () => icon.ToBitmap()); 700AssertExtensions.Throws<ArgumentException>("handle", null, () => Icon.FromHandle(IntPtr.Zero));
System\Drawing\ImageTests.cs (25)
112AssertExtensions.Throws<ArgumentException>(null, () => bitmap.GetPropertyItem(propid)); 122AssertExtensions.Throws<ArgumentException>(null, () => bitmap.GetPropertyItem(propid)); 139AssertExtensions.Throws<ArgumentException>(null, () => bitmap.GetPropertyItem(PropertyTagExifUserComment)); 140AssertExtensions.Throws<ArgumentException>(null, () => bitmap.RemovePropertyItem(PropertyTagExifUserComment)); 144AssertExtensions.Throws<ArgumentException>(null, () => bitmap.GetPropertyItem(PropertyTagLuminanceTable)); 145AssertExtensions.Throws<ArgumentException>(null, () => bitmap.RemovePropertyItem(PropertyTagLuminanceTable)); 149AssertExtensions.Throws<ArgumentException>(null, () => bitmap.GetPropertyItem(PropertyTagChrominanceTable)); 159AssertExtensions.Throws<ArgumentException>(null, () => bitmap.GetPropertyItem(PropertyTagExifUserComment)); 160AssertExtensions.Throws<ArgumentException>(null, () => bitmap.RemovePropertyItem(PropertyTagExifUserComment)); 164AssertExtensions.Throws<ArgumentException>(null, () => bitmap.GetPropertyItem(PropertyTagLuminanceTable)); 165AssertExtensions.Throws<ArgumentException>(null, () => bitmap.RemovePropertyItem(PropertyTagLuminanceTable)); 169AssertExtensions.Throws<ArgumentException>(null, () => bitmap.GetPropertyItem(PropertyTagChrominanceTable)); 208AssertExtensions.Throws<ArgumentException>(null, () => bitmap.RemovePropertyItem(propid)); 218AssertExtensions.Throws<ArgumentException>(null, () => bitmap.RemovePropertyItem(propid)); 503AssertExtensions.Throws<ArgumentNullException>("path", () => Image.FromFile(null)); 504AssertExtensions.Throws<ArgumentNullException>("path", () => Image.FromFile(null, useEmbeddedColorManagement: true)); 510AssertExtensions.Throws<ArgumentException>("path", null, () => Image.FromFile(string.Empty)); 511AssertExtensions.Throws<ArgumentException>("path", null, () => Image.FromFile(string.Empty, useEmbeddedColorManagement: true)); 551AssertExtensions.Throws<ArgumentException>(null, () => Image.FromStream(stream)); 554AssertExtensions.Throws<ArgumentException>(null, () => Image.FromStream(stream, useEmbeddedColorManagement: true)); 555AssertExtensions.Throws<ArgumentException>(null, () => Image.FromStream(stream, useEmbeddedColorManagement: true, validateImageData: true)); 562AssertExtensions.Throws<ArgumentNullException, ArgumentException>("stream", null, () => Image.FromStream(null)); 563AssertExtensions.Throws<ArgumentNullException, ArgumentException>("stream", null, () => Image.FromStream(null, useEmbeddedColorManagement: true)); 564AssertExtensions.Throws<ArgumentNullException, ArgumentException>("stream", null, () => Image.FromStream(null, useEmbeddedColorManagement: true, validateImageData: true)); 664AssertExtensions.Throws<DirectoryNotFoundException>(() => bitmap.Save(badTarget), $"The directory NoSuchDirectory of the filename {badTarget} does not exist.");
System\Drawing\Imaging\ImageAttributesTests.cs (71)
87AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.Clone()); 220AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.SetColorMatrix(_greenComponentToZeroColorMatrix)); 221AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.SetColorMatrix(_greenComponentToZeroColorMatrix, ColorMatrixFlag.Default)); 222AssertExtensions.Throws<ArgumentException>(null, () => 230AssertExtensions.Throws<ArgumentNullException>("newColorMatrix", () => imageAttr.SetColorMatrix(null)); 231AssertExtensions.Throws<ArgumentNullException>("newColorMatrix", () => imageAttr.SetColorMatrix(null, ColorMatrixFlag.Default)); 232AssertExtensions.Throws<ArgumentNullException>("newColorMatrix", () => 249AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.SetColorMatrix(_greenComponentToZeroColorMatrix, ColorMatrixFlag.Default, type)); 266AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.SetColorMatrix(_greenComponentToZeroColorMatrix, flag)); 267AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.SetColorMatrix(_greenComponentToZeroColorMatrix, flag, ColorAdjustType.Default)); 326AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.ClearColorMatrix()); 327AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.ClearColorMatrix(ColorAdjustType.Default)); 335AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.ClearColorMatrix(type)); 438AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.SetColorMatrices(_greenComponentToZeroColorMatrix, _grayMatrix)); 439AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.SetColorMatrices(_greenComponentToZeroColorMatrix, _grayMatrix, ColorMatrixFlag.Default)); 440AssertExtensions.Throws<ArgumentException>(null, () => 448AssertExtensions.Throws<ArgumentNullException>("newColorMatrix", () => imageAttr.SetColorMatrices(null, _grayMatrix)); 449AssertExtensions.Throws<ArgumentNullException>("newColorMatrix", () => imageAttr.SetColorMatrices(null, _grayMatrix, ColorMatrixFlag.Default)); 450AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.SetColorMatrices(_greenComponentToZeroColorMatrix, null, ColorMatrixFlag.AltGrays)); 451AssertExtensions.Throws<ArgumentNullException>("newColorMatrix", () => 453AssertExtensions.Throws<ArgumentException>(null, () => 462AssertExtensions.Throws<ArgumentException>(null, () => 474AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.SetColorMatrices(_greenComponentToZeroColorMatrix, _grayMatrix, flag)); 475AssertExtensions.Throws<ArgumentException>(null, () => 523AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.SetThreshold(0.5f)); 531AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.SetThreshold(0.5f, type)); 567AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.ClearThreshold(ColorAdjustType.Default)); 575AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.ClearThreshold(type)); 622AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.SetGamma(2.2f)); 623AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.SetGamma(2.2f, ColorAdjustType.Default)); 631AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.SetGamma(2.2f, type)); 655AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.ClearGamma(ColorAdjustType.Default)); 663AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.ClearGamma(type)); 702AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.SetNoOp()); 703AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.SetNoOp(ColorAdjustType.Default)); 711AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.SetNoOp(type)); 770AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.ClearNoOp()); 771AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.ClearNoOp(ColorAdjustType.Default)); 779AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.ClearNoOp(type)); 831AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.SetColorKey(Color.FromArgb(50, 50, 50), Color.FromArgb(150, 150, 150))); 832AssertExtensions.Throws<ArgumentException>(null, () => 841AssertExtensions.Throws<ArgumentException>(null, () => 880AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.ClearColorKey()); 881AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.ClearColorKey(ColorAdjustType.Default)); 889AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.ClearColorKey(type)); 976AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.SetOutputChannel(ColorChannelFlag.ColorChannelY)); 977AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.SetOutputChannel(ColorChannelFlag.ColorChannelY, ColorAdjustType.Default)); 985AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.SetOutputChannel(ColorChannelFlag.ColorChannelY, type)); 1002AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.SetOutputChannel(flag)); 1003AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.SetOutputChannel(flag, ColorAdjustType.Default)); 1041AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.ClearOutputChannel()); 1042AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.ClearOutputChannel(ColorAdjustType.Default)); 1050AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.ClearOutputChannel(type)); 1072AssertExtensions.Throws<ArgumentException>(null, () => 1074AssertExtensions.Throws<ArgumentException>(null, () => 1116AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.SetOutputChannelColorProfile("path", type)); 1156AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.ClearOutputChannelColorProfile()); 1157AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.ClearOutputChannelColorProfile(ColorAdjustType.Default)); 1165AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.ClearOutputChannelColorProfile(type)); 1212AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.SetRemapTable(_yellowToRedColorMap)); 1213AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.SetRemapTable(_yellowToRedColorMap, ColorAdjustType.Default)); 1221AssertExtensions.ThrowsAny<ArgumentNullException, ArgumentException>(() => imageAttr.SetRemapTable(_yellowToRedColorMap, type)); 1242AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.SetRemapTable([], ColorAdjustType.Default)); 1278AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.ClearRemapTable()); 1279AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.ClearRemapTable(ColorAdjustType.Default)); 1287AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.ClearRemapTable(type)); 1296AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.SetWrapMode(WrapMode.Clamp)); 1297AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.SetWrapMode(WrapMode.Clamp, Color.Black)); 1298AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.SetWrapMode(WrapMode.Clamp, Color.Black, true)); 1308AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.GetAdjustedPalette(bitmap.Palette, ColorAdjustType.Default)); 1324AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.GetAdjustedPalette(bitmap.Palette, type));
System\Drawing\Imaging\MetafileTests.cs (80)
40AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(IntPtr.Zero, false)); 66AssertExtensions.Throws<ArgumentNullException>("path", () => new Metafile((string)null)); 87AssertExtensions.Throws<ArgumentException>("path", null, () => new Metafile(path)); 101AssertExtensions.Throws<ArgumentNullException, ArgumentException>("stream", null, () => new Metafile((Stream)null)); 143AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(g.GetHdc(), emfType)); 149AssertExtensions.Throws<ArgumentException>(null, () => new Metafile((IntPtr)null, EmfType.EmfOnly)); 155AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(IntPtr.Zero, EmfType.EmfOnly)); 178AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(IntPtr.Zero, EmfType.EmfOnly, description)); 274AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(IntPtr.Zero, _rectangleF)); 275AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(IntPtr.Zero, _rectangleF, MetafileFrameUnit.Pixel)); 276AssertExtensions.Throws<ArgumentException>(null, () => 278AssertExtensions.Throws<ArgumentException>(null, () => 281AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(IntPtr.Zero, _rectangle)); 282AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(IntPtr.Zero, _rectangle, MetafileFrameUnit.Pixel)); 283AssertExtensions.Throws<ArgumentException>(null, () => 285AssertExtensions.Throws<ArgumentException>(null, () => 304AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(referenceHdc, _rectangleF, farameUnit)); 305AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(referenceHdc, _rectangleF, farameUnit, EmfType.EmfOnly)); 306AssertExtensions.Throws<ArgumentException>(null, () => 309AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(referenceHdc, _rectangle, farameUnit)); 310AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(referenceHdc, _rectangle, farameUnit, EmfType.EmfOnly)); 311AssertExtensions.Throws<ArgumentException>(null, () => 322AssertExtensions.Throws<ArgumentException>(null, () => 324AssertExtensions.Throws<ArgumentException>(null, () => 327AssertExtensions.Throws<ArgumentException>(null, () => 329AssertExtensions.Throws<ArgumentException>(null, () => 386AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(fileName, IntPtr.Zero)); 387AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(fileName, IntPtr.Zero, EmfType.EmfOnly)); 388AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(fileName, IntPtr.Zero, EmfType.EmfOnly, "description")); 400AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(fileName, referenceHdc, emfType)); 401AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(fileName, referenceHdc, emfType, "description")); 411AssertExtensions.Throws<ArgumentNullException>("path", () => new Metafile((string)null, referenceHdc)); 412AssertExtensions.Throws<ArgumentNullException>("path", () => new Metafile((string)null, referenceHdc, EmfType.EmfOnly)); 413AssertExtensions.Throws<ArgumentNullException>("path", () => new Metafile((string)null, referenceHdc, EmfType.EmfOnly, "description")); 424AssertExtensions.Throws<ArgumentException>("path", null, () => new Metafile(fileName, referenceHdc)); 425AssertExtensions.Throws<ArgumentException>("path", null, () => new Metafile(fileName, referenceHdc, EmfType.EmfOnly)); 426AssertExtensions.Throws<ArgumentException>("path", null, () => new Metafile(fileName, referenceHdc, EmfType.EmfOnly, "description")); 614AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(fileName, IntPtr.Zero, _rectangleF)); 615AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(fileName, IntPtr.Zero, _rectangleF, MetafileFrameUnit.GdiCompatible)); 616AssertExtensions.Throws<ArgumentException>(null, () => 618AssertExtensions.Throws<ArgumentException>(null, () => 621AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(fileName, IntPtr.Zero, _rectangle)); 622AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(fileName, IntPtr.Zero, _rectangle, MetafileFrameUnit.GdiCompatible)); 623AssertExtensions.Throws<ArgumentException>(null, () => 625AssertExtensions.Throws<ArgumentException>(null, () => 638AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(fileName, referenceHdc, _rectangleF, frameUnit)); 639AssertExtensions.Throws<ArgumentException>(null, () => 641AssertExtensions.Throws<ArgumentException>(null, () => 644AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(fileName, referenceHdc, _rectangle, frameUnit)); 645AssertExtensions.Throws<ArgumentException>(null, () => 647AssertExtensions.Throws<ArgumentException>(null, () => 660AssertExtensions.Throws<ArgumentException>(null, () => 662AssertExtensions.Throws<ArgumentException>(null, () => 665AssertExtensions.Throws<ArgumentException>(null, () => 667AssertExtensions.Throws<ArgumentException>(null, () => 678AssertExtensions.Throws<ArgumentNullException>("path", () => new Metafile((string)null, referenceHdc, _rectangleF)); 679AssertExtensions.Throws<ArgumentNullException>("path", () => 681AssertExtensions.Throws<ArgumentNullException>("path", () => 683AssertExtensions.Throws<ArgumentNullException>("path", () => 695AssertExtensions.Throws<ArgumentException, ArgumentException>("path", null, () => new Metafile(fileName, referenceHdc, _rectangleF)); 696AssertExtensions.Throws<ArgumentException, ArgumentException>("path", null, () => 698AssertExtensions.Throws<ArgumentException, ArgumentException>("path", null, () => 700AssertExtensions.Throws<ArgumentException, ArgumentException>("path", null, () => 784AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(stream, IntPtr.Zero, _rectangle)); 785AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(stream, IntPtr.Zero, _rectangle, MetafileFrameUnit.GdiCompatible)); 786AssertExtensions.Throws<ArgumentException>(null, () => 788AssertExtensions.Throws<ArgumentException>(null, () => 800AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(stream, referenceHdc, _rectangle, frameUnit)); 801AssertExtensions.Throws<ArgumentException>(null, () => 803AssertExtensions.Throws<ArgumentException>(null, () => 815AssertExtensions.Throws<ArgumentException>(null, () => 817AssertExtensions.Throws<ArgumentException>(null, () => 845AssertExtensions.Throws<ArgumentException>(null, () => Metafile.GetMetafileHeader(IntPtr.Zero)); 847AssertExtensions.Throws<ArgumentException>(null, () => Metafile.GetMetafileHeader(metafile.GetHenhmetafile())); 855AssertExtensions.Throws<ArgumentException>("path", null, () => Metafile.GetMetafileHeader(fileName)); 861AssertExtensions.Throws<ArgumentNullException>("path", () => Metafile.GetMetafileHeader((string)null)); 882AssertExtensions.Throws<ArgumentException>(null, () => Metafile.GetMetafileHeader(stream)); 901AssertExtensions.Throws<ArgumentException>(null, () => metafile.GetMetafileHeader()); 917AssertExtensions.Throws<ArgumentException>(null, () => metafile.GetHenhmetafile()); 926AssertExtensions.Throws<ArgumentException>(null, () =>
System\Drawing\PensTests.cs (1)
164AssertExtensions.Throws<ArgumentException>(null, () => pen.Color = Color.AliceBlue);
System\Drawing\PenTests.cs (71)
77AssertExtensions.Throws<ArgumentNullException>("brush", () => new Pen(null)); 78AssertExtensions.Throws<ArgumentNullException>("brush", () => new Pen(null, 0)); 87AssertExtensions.Throws<ArgumentException>(null, () => new Pen(brush)); 88AssertExtensions.Throws<ArgumentException>(null, () => new Pen(brush, 10)); 145AssertExtensions.Throws<ArgumentException>(null, () => pen.Alignment); 146AssertExtensions.Throws<ArgumentException>(null, () => pen.Alignment = PenAlignment.Center); 163AssertExtensions.Throws<ArgumentException>(null, () => pen.Brush = new SubBrush()); 176AssertExtensions.Throws<ArgumentNullException>("value", () => pen.Brush = null); 185AssertExtensions.Throws<ArgumentException>(null, () => pen.Brush = brush); 195AssertExtensions.Throws<ArgumentException>(null, () => pen.Brush); 196AssertExtensions.Throws<ArgumentException>(null, () => pen.Brush = brush); 231AssertExtensions.Throws<ArgumentException>(null, () => pen.Clone()); 260AssertExtensions.Throws<ArgumentException>(null, () => pen.Color); 290AssertExtensions.Throws<ArgumentException>(null, () => pen.Color = Color.Black); 300AssertExtensions.Throws<ArgumentException>(null, () => pen.Color); 301AssertExtensions.Throws<ArgumentException>(null, () => pen.Color = Color.Red); 333AssertExtensions.Throws<ArgumentException>(null, () => pen.CompoundArray = []); 349AssertExtensions.Throws<ArgumentException>(null, () => pen.CompoundArray = compoundArray); 359AssertExtensions.Throws<ArgumentException>(null, () => pen.CompoundArray); 360AssertExtensions.Throws<ArgumentException>(null, () => pen.CompoundArray = [1]); 385AssertExtensions.Throws<ArgumentException>(null, () => pen.CustomEndCap = null); 398AssertExtensions.Throws<ArgumentException>(null, () => pen.CustomEndCap = lineCap); 411AssertExtensions.Throws<ArgumentException>(null, () => pen.CustomEndCap); 412AssertExtensions.Throws<ArgumentException>(null, () => pen.CustomEndCap = lineCap); 437AssertExtensions.Throws<ArgumentException>(null, () => pen.CustomStartCap = null); 450AssertExtensions.Throws<ArgumentException>(null, () => pen.CustomStartCap = lineCap); 463AssertExtensions.Throws<ArgumentException>(null, () => pen.CustomStartCap); 464AssertExtensions.Throws<ArgumentException>(null, () => pen.CustomStartCap = lineCap); 497AssertExtensions.Throws<ArgumentException>(null, () => pen.DashCap); 498AssertExtensions.Throws<ArgumentException>(null, () => pen.DashCap = DashCap.Triangle); 523AssertExtensions.Throws<ArgumentException>(null, () => pen.DashOffset); 524AssertExtensions.Throws<ArgumentException>(null, () => pen.DashOffset = 10); 550AssertExtensions.Throws<ArgumentException>(null, () => pen.DashPattern = null); 558AssertExtensions.Throws<ArgumentException>(null, () => pen.DashPattern = []); 570AssertExtensions.Throws<ArgumentException>(null, () => pen.DashPattern = pattern); 580AssertExtensions.Throws<ArgumentException>(null, () => pen.DashPattern); 581AssertExtensions.Throws<ArgumentException>(null, () => pen.DashPattern = [1]); 637AssertExtensions.Throws<ArgumentException>(null, () => pen.DashStyle); 638AssertExtensions.Throws<ArgumentException>(null, () => pen.DashStyle = DashStyle.Dash); 691AssertExtensions.Throws<ArgumentException>(null, () => pen.EndCap); 692AssertExtensions.Throws<ArgumentException>(null, () => pen.EndCap = LineCap.ArrowAnchor); 725AssertExtensions.Throws<ArgumentException>(null, () => pen.LineJoin); 726AssertExtensions.Throws<ArgumentException>(null, () => pen.LineJoin = LineJoin.Miter); 751AssertExtensions.Throws<ArgumentException>(null, () => pen.MiterLimit); 752AssertExtensions.Throws<ArgumentException>(null, () => pen.MiterLimit = 10); 807AssertExtensions.Throws<ArgumentException>(null, () => pen.MultiplyTransform(matrix)); 808AssertExtensions.Throws<ArgumentException>(null, () => pen.MultiplyTransform(matrix, MatrixOrder.Prepend)); 851AssertExtensions.Throws<ArgumentException>(null, () => pen.MultiplyTransform(matrix)); 852AssertExtensions.Throws<ArgumentException>(null, () => pen.MultiplyTransform(matrix, MatrixOrder.Prepend)); 878AssertExtensions.Throws<ArgumentException>(null, () => pen.ResetTransform()); 924AssertExtensions.Throws<ArgumentException>(null, () => pen.RotateTransform(10, matrixOrder)); 935AssertExtensions.Throws<ArgumentException>(null, () => pen.RotateTransform(1)); 936AssertExtensions.Throws<ArgumentException>(null, () => pen.RotateTransform(1, MatrixOrder.Prepend)); 984AssertExtensions.Throws<ArgumentException>(null, () => pen.ScaleTransform(1, 2, matrixOrder)); 995AssertExtensions.Throws<ArgumentException>(null, () => pen.ScaleTransform(1, 2)); 996AssertExtensions.Throws<ArgumentException>(null, () => pen.ScaleTransform(1, 2, MatrixOrder.Prepend)); 1026AssertExtensions.Throws<ArgumentException>(null, () => pen.SetLineCap(LineCap.AnchorMask, LineCap.ArrowAnchor, DashCap.Flat)); 1055AssertExtensions.Throws<ArgumentException>(null, () => pen.StartCap); 1056AssertExtensions.Throws<ArgumentException>(null, () => pen.StartCap = LineCap.ArrowAnchor); 1079AssertExtensions.Throws<ArgumentNullException>("value", () => pen.Transform = null); 1088AssertExtensions.Throws<ArgumentException>(null, () => pen.Transform = matrix); 1099AssertExtensions.Throws<ArgumentException>(null, () => pen.Transform = matrix); 1110AssertExtensions.Throws<ArgumentException>(null, () => pen.Transform); 1111AssertExtensions.Throws<ArgumentException>(null, () => pen.Transform = matrix); 1159AssertExtensions.Throws<ArgumentException>(null, () => pen.TranslateTransform(1, 2, matrixOrder)); 1170AssertExtensions.Throws<ArgumentException>(null, () => pen.TranslateTransform(1, 2)); 1171AssertExtensions.Throws<ArgumentException>(null, () => pen.TranslateTransform(1, 2, MatrixOrder.Prepend)); 1196AssertExtensions.Throws<ArgumentException>(null, () => pen.Width); 1197AssertExtensions.Throws<ArgumentException>(null, () => pen.Width = 10); 1208AssertExtensions.Throws<ArgumentException>(null, () => pen.CustomEndCap); 1209AssertExtensions.Throws<ArgumentException>(null, () => pen.CustomStartCap);
System\Drawing\Printing\MarginsConverterTests.cs (3)
89AssertExtensions.Throws<ArgumentException, Exception>(() => mc.ConvertFrom(context, culture, "1;2;3;4")); 112AssertExtensions.Throws<ArgumentException, Exception>(() => mc.ConvertFrom(context, null, "wrong string format")); 113AssertExtensions.Throws<ArgumentException, Exception>(() => mc.ConvertFrom(context, culture, "wrong string format"));
System\Drawing\Printing\MarginsTests.cs (8)
58AssertExtensions.Throws<ArgumentOutOfRangeException, ArgumentException>("left", null, () => new Margins(-1, 2, 3, 4)); 64AssertExtensions.Throws<ArgumentOutOfRangeException, ArgumentException>("right", null, () => new Margins(1, -1, 3, 4)); 70AssertExtensions.Throws<ArgumentOutOfRangeException, ArgumentException>("top", null, () => new Margins(1, 2, -1, 4)); 76AssertExtensions.Throws<ArgumentOutOfRangeException, ArgumentException>("bottom", null, () => new Margins(1, 2, 3, -1)); 178AssertExtensions.Throws<ArgumentOutOfRangeException, ArgumentException>("value", null, () => margins.Left = -1); 200AssertExtensions.Throws<ArgumentOutOfRangeException, ArgumentException>("value", null, () => margins.Right = -1); 222AssertExtensions.Throws<ArgumentOutOfRangeException, ArgumentException>("value", null, () => margins.Top = -1); 244AssertExtensions.Throws<ArgumentOutOfRangeException, ArgumentException>("value", null, () => margins.Bottom = -1);
System\Drawing\Printing\PaperSizeTests.cs (3)
116AssertExtensions.Throws<ArgumentException>("value", null, () => size.Height = 1); 153AssertExtensions.Throws<ArgumentException>("value", null, () => size.PaperName = "name"); 214AssertExtensions.Throws<ArgumentException>("value", null, () => size.Width = 1);
System\Drawing\Printing\PrinterSettingsTests.cs (8)
75AssertExtensions.Throws<ArgumentException>(null, () => printerSettings.Copies = copies); 155AssertExtensions.Throws<ArgumentException>(null, () => printerSettings.FromPage = pageNumber); 231AssertExtensions.Throws<ArgumentException>(null, () => printerSettings.MaximumPage = maximumPage); 260AssertExtensions.Throws<ArgumentException>(null, () => printerSettings.MinimumPage = minimumPage); 279AssertExtensions.Throws<ArgumentNullException>(null, () => printerSettings.PrintFileName = null); 286AssertExtensions.Throws<ArgumentNullException>(string.Empty, () => printerSettings.PrintFileName = string.Empty); 442AssertExtensions.Throws<ArgumentException>(null, () => printerSettings.ToPage = toPage); 587AssertExtensions.Throws<ArgumentException>(null, () => printerSettings.SetHdevmode(IntPtr.Zero));
System\Drawing\RegionTests.cs (82)
121AssertExtensions.Throws<ArgumentNullException>("rgnData", () => new Region((RegionData)null)); 130AssertExtensions.Throws<ArgumentException>(null, () => new Region(regionData)); 245AssertExtensions.Throws<ArgumentNullException>("path", () => new Region((GraphicsPath)null)); 254AssertExtensions.Throws<ArgumentException>(null, () => new Region(path)); 275AssertExtensions.Throws<ArgumentException>(null, () => CreateDisposedRegion().Clone()); 406AssertExtensions.Throws<ArgumentNullException>("region", () => region.Complement((Region)null)); 412AssertExtensions.Throws<ArgumentException>(null, () => new Region().Complement(CreateDisposedRegion())); 509AssertExtensions.Throws<ArgumentNullException>("path", () => region.Complement((GraphicsPath)null)); 519AssertExtensions.Throws<ArgumentException>(null, () => disposedRegion.Complement(graphicPath)); 520AssertExtensions.Throws<ArgumentException>(null, () => disposedRegion.Complement(new Rectangle())); 521AssertExtensions.Throws<ArgumentException>(null, () => disposedRegion.Complement(new RectangleF())); 522AssertExtensions.Throws<ArgumentException>(null, () => disposedRegion.Complement(disposedRegion)); 592AssertExtensions.Throws<ArgumentNullException>("region", () => region.Equals(null, s_graphic)); 599AssertExtensions.Throws<ArgumentNullException>("g", () => region.Equals(region, null)); 610AssertExtensions.Throws<ArgumentException>(null, () => region.Equals(region, graphics)); 618AssertExtensions.Throws<ArgumentException>(null, () => disposedRegion.Equals(new Region(), s_graphic)); 619AssertExtensions.Throws<ArgumentException>(null, () => new Region().Equals(disposedRegion, s_graphic)); 813AssertExtensions.Throws<ArgumentNullException>("region", () => region.Exclude((Region)null)); 819AssertExtensions.Throws<ArgumentException>(null, () => new Region().Exclude(CreateDisposedRegion())); 892AssertExtensions.Throws<ArgumentNullException>("path", () => region.Exclude((GraphicsPath)null)); 902AssertExtensions.Throws<ArgumentException>(null, () => disposedRegion.Exclude(graphicsPath)); 903AssertExtensions.Throws<ArgumentException>(null, () => disposedRegion.Exclude(new Rectangle())); 904AssertExtensions.Throws<ArgumentException>(null, () => disposedRegion.Exclude(new RectangleF())); 905AssertExtensions.Throws<ArgumentException>(null, () => disposedRegion.Exclude(other)); 930AssertExtensions.Throws<ArgumentException>(null, () => Region.FromHrgn(IntPtr.Zero)); 961AssertExtensions.Throws<ArgumentNullException>("g", () => region.GetHrgn(null)); 967AssertExtensions.Throws<ArgumentException>(null, () => CreateDisposedRegion().GetHrgn(s_graphic)); 974AssertExtensions.Throws<ArgumentNullException>("regionHandle", () => region.ReleaseHrgn(IntPtr.Zero)); 981AssertExtensions.Throws<ArgumentNullException>("g", () => region.GetBounds(null)); 991AssertExtensions.Throws<ArgumentException>(null, () => region.GetBounds(graphics)); 997AssertExtensions.Throws<ArgumentException>(null, () => CreateDisposedRegion().GetBounds(s_graphic)); 1003AssertExtensions.Throws<ArgumentException>(null, () => CreateDisposedRegion().GetRegionData()); 1023AssertExtensions.Throws<ArgumentNullException>("matrix", () => region.GetRegionScans(null)); 1030AssertExtensions.Throws<ArgumentException>(null, () => CreateDisposedRegion().GetRegionScans(matrix)); 1039AssertExtensions.Throws<ArgumentException>(null, () => region.GetRegionScans(matrix)); 1146AssertExtensions.Throws<ArgumentNullException>("region", () => region.Intersect((Region)null)); 1152AssertExtensions.Throws<ArgumentException>(null, () => new Region().Intersect(CreateDisposedRegion())); 1249AssertExtensions.Throws<ArgumentNullException>("path", () => region.Intersect((GraphicsPath)null)); 1259AssertExtensions.Throws<ArgumentException>(null, () => disposedRegion.Intersect(graphicsPath)); 1260AssertExtensions.Throws<ArgumentException>(null, () => disposedRegion.Intersect(new Rectangle())); 1261AssertExtensions.Throws<ArgumentException>(null, () => disposedRegion.Intersect(new RectangleF())); 1262AssertExtensions.Throws<ArgumentException>(null, () => disposedRegion.Intersect(other)); 1269AssertExtensions.Throws<ArgumentNullException>("g", () => region.IsEmpty(null)); 1275AssertExtensions.Throws<ArgumentException>(null, () => CreateDisposedRegion().IsEmpty(s_graphic)); 1282AssertExtensions.Throws<ArgumentNullException>("g", () => region.IsInfinite(null)); 1292AssertExtensions.Throws<ArgumentException>(null, () => region.IsInfinite(graphics)); 1298AssertExtensions.Throws<ArgumentException>(null, () => CreateDisposedRegion().IsInfinite(s_graphic)); 1415AssertExtensions.Throws<ArgumentException>(null, () => disposedRegion.IsVisible(1f, 2f)); 1416AssertExtensions.Throws<ArgumentException>(null, () => disposedRegion.IsVisible(new PointF(1, 2))); 1417AssertExtensions.Throws<ArgumentException>(null, () => disposedRegion.IsVisible(new Point(1, 2))); 1419AssertExtensions.Throws<ArgumentException>(null, () => disposedRegion.IsVisible(1f, 2f, s_graphic)); 1420AssertExtensions.Throws<ArgumentException>(null, () => disposedRegion.IsVisible(new PointF(1, 2), s_graphic)); 1421AssertExtensions.Throws<ArgumentException>(null, () => disposedRegion.IsVisible(new Point(1, 2), s_graphic)); 1423AssertExtensions.Throws<ArgumentException>(null, () => disposedRegion.IsVisible(1f, 2f, 3f, 4f)); 1424AssertExtensions.Throws<ArgumentException>(null, () => disposedRegion.IsVisible(new Rectangle(1, 2, 3, 4))); 1425AssertExtensions.Throws<ArgumentException>(null, () => disposedRegion.IsVisible(new RectangleF(1, 2, 3, 4))); 1427AssertExtensions.Throws<ArgumentException>(null, () => disposedRegion.IsVisible(1f, 2f, 3f, 4f, s_graphic)); 1428AssertExtensions.Throws<ArgumentException>(null, () => disposedRegion.IsVisible(new Rectangle(1, 2, 3, 4), s_graphic)); 1429AssertExtensions.Throws<ArgumentException>(null, () => disposedRegion.IsVisible(new RectangleF(1, 2, 3, 4), s_graphic)); 1431AssertExtensions.Throws<ArgumentException>(null, () => disposedRegion.IsVisible(1, 2, s_graphic)); 1432AssertExtensions.Throws<ArgumentException>(null, () => disposedRegion.IsVisible(1, 2, 3, 4)); 1433AssertExtensions.Throws<ArgumentException>(null, () => disposedRegion.IsVisible(1, 2, 3, 4, s_graphic)); 1460AssertExtensions.Throws<ArgumentException>(null, () => CreateDisposedRegion().MakeEmpty()); 1483AssertExtensions.Throws<ArgumentException>(null, () => CreateDisposedRegion().MakeInfinite()); 1708AssertExtensions.Throws<ArgumentNullException>("region", () => region.Union((Region)null)); 1715AssertExtensions.Throws<ArgumentException>(null, () => region.Union(CreateDisposedRegion())); 1788AssertExtensions.Throws<ArgumentNullException>("path", () => region.Union((GraphicsPath)null)); 1798AssertExtensions.Throws<ArgumentException>(null, () => disposedRegion.Union(graphicsPath)); 1799AssertExtensions.Throws<ArgumentException>(null, () => disposedRegion.Union(new Rectangle())); 1800AssertExtensions.Throws<ArgumentException>(null, () => disposedRegion.Union(new RectangleF())); 1801AssertExtensions.Throws<ArgumentException>(null, () => disposedRegion.Union(disposedRegion)); 1876AssertExtensions.Throws<ArgumentNullException>("matrix", () => region.Transform(null)); 1883AssertExtensions.Throws<ArgumentException>(null, () => CreateDisposedRegion().Transform(matrix)); 1967AssertExtensions.Throws<ArgumentException>(null, () => disposedRegion.Translate(1, 2)); 1968AssertExtensions.Throws<ArgumentException>(null, () => disposedRegion.Translate(1f, 2f)); 2066AssertExtensions.Throws<ArgumentNullException>("region", () => region.Xor((Region)null)); 2073AssertExtensions.Throws<ArgumentException>(null, () => region.Xor(CreateDisposedRegion())); 2146AssertExtensions.Throws<ArgumentNullException>("path", () => region.Xor((GraphicsPath)null)); 2156AssertExtensions.Throws<ArgumentException>(null, () => disposedRegion.Xor(graphicsPath)); 2157AssertExtensions.Throws<ArgumentException>(null, () => disposedRegion.Xor(new Rectangle())); 2158AssertExtensions.Throws<ArgumentException>(null, () => disposedRegion.Xor(new RectangleF())); 2159AssertExtensions.Throws<ArgumentException>(null, () => disposedRegion.Xor(other));
System\Drawing\SolidBrushTests.cs (5)
56AssertExtensions.Throws<ArgumentException>(null, () => brush.Clone()); 65AssertExtensions.Throws<ArgumentException>(null, () => brush.Color); 90AssertExtensions.Throws<ArgumentException>(null, () => brush.Color = Color.WhiteSmoke); 97AssertExtensions.Throws<ArgumentException>(null, () => brush.Color = Color.AntiqueWhite); 112AssertExtensions.Throws<ArgumentException>(null, () => brush.Dispose());
System\Drawing\StringFormatTests.cs (21)
78AssertExtensions.Throws<ArgumentNullException>("format", () => new StringFormat(null)); 87AssertExtensions.Throws<ArgumentException>(null, () => new StringFormat(format)); 122AssertExtensions.Throws<ArgumentException>(null, () => format.Clone()); 144AssertExtensions.Throws<ArgumentException>(null, () => format.SetDigitSubstitution(0, StringDigitSubstitute.None)); 170AssertExtensions.Throws<ArgumentException>(null, () => format.SetTabStops(-1, [])); 186AssertExtensions.Throws<ArgumentException>(null, () => format.SetTabStops(0, [])); 195AssertExtensions.Throws<ArgumentException>(null, () => format.GetTabStops(out float firstTabOffset)); 234AssertExtensions.Throws<ArgumentException>(null, () => format.SetMeasurableCharacterRanges([])); 262AssertExtensions.Throws<ArgumentException>(null, () => format.Alignment); 263AssertExtensions.Throws<ArgumentException>(null, () => format.Alignment = StringAlignment.Center); 272AssertExtensions.Throws<ArgumentException>(null, () => format.DigitSubstitutionMethod); 281AssertExtensions.Throws<ArgumentException>(null, () => format.DigitSubstitutionLanguage); 300AssertExtensions.Throws<ArgumentException>(null, () => format.FormatFlags); 301AssertExtensions.Throws<ArgumentException>(null, () => format.FormatFlags = StringFormatFlags.NoClip); 329AssertExtensions.Throws<ArgumentException>(null, () => format.LineAlignment); 330AssertExtensions.Throws<ArgumentException>(null, () => format.LineAlignment = StringAlignment.Center); 358AssertExtensions.Throws<ArgumentException>(null, () => format.HotkeyPrefix); 359AssertExtensions.Throws<ArgumentException>(null, () => format.HotkeyPrefix = HotkeyPrefix.Hide); 385AssertExtensions.Throws<ArgumentException>(null, () => format.Trimming); 386AssertExtensions.Throws<ArgumentException>(null, () => format.Trimming = StringTrimming.Word); 432AssertExtensions.Throws<ArgumentException>(null, () => format.ToString());
System\Drawing\SystemBrushesTests.cs (2)
53AssertExtensions.Throws<ArgumentException>(null, () => brush.Color = Color.Red); 61AssertExtensions.Throws<ArgumentException>(null, () => SystemBrushes.FromSystemColor(Color.Blue));
System\Drawing\SystemPensTest.cs (19)
58AssertExtensions.Throws<ArgumentException>(null, () => pen.Dispose()); 59AssertExtensions.Throws<ArgumentException>(null, () => pen.SetLineCap(LineCap.ArrowAnchor, LineCap.Custom, DashCap.Round)); 61AssertExtensions.Throws<ArgumentException>(null, () => pen.Alignment = PenAlignment.Center); 62AssertExtensions.Throws<ArgumentException>(null, () => pen.Brush = null); 63AssertExtensions.Throws<ArgumentException>(null, () => pen.Color = Color.AliceBlue); 64AssertExtensions.Throws<ArgumentException>(null, () => pen.CompoundArray = null); 65AssertExtensions.Throws<ArgumentException>(null, () => pen.CustomEndCap = null); 66AssertExtensions.Throws<ArgumentException>(null, () => pen.CustomStartCap = null); 67AssertExtensions.Throws<ArgumentException>(null, () => pen.DashCap = DashCap.Flat); 68AssertExtensions.Throws<ArgumentException>(null, () => pen.DashStyle = DashStyle.Custom); 69AssertExtensions.Throws<ArgumentException>(null, () => pen.DashOffset = 10); 70AssertExtensions.Throws<ArgumentException>(null, () => pen.DashPattern = null); 71AssertExtensions.Throws<ArgumentException>(null, () => pen.EndCap = LineCap.RoundAnchor); 72AssertExtensions.Throws<ArgumentException>(null, () => pen.LineJoin = LineJoin.MiterClipped); 73AssertExtensions.Throws<ArgumentException>(null, () => pen.MiterLimit = 10); 74AssertExtensions.Throws<ArgumentException>(null, () => pen.StartCap = LineCap.RoundAnchor); 77AssertExtensions.Throws<ArgumentException>(null, () => pen.Transform = matrix); 80AssertExtensions.Throws<ArgumentException>(null, () => pen.Width = 10); 86AssertExtensions.Throws<ArgumentException>(null, () => SystemPens.FromSystemColor(Color.Blue));
System\Drawing\Text\PrivateFontCollectionTests.cs (8)
93AssertExtensions.Throws<ArgumentNullException>("filename", "path", () => fontCollection.AddFontFile(null)); 100AssertExtensions.Throws<FileNotFoundException>(() => fontCollection.AddFontFile(string.Empty)); 122AssertExtensions.Throws<FileNotFoundException, ExternalException>(() => fontCollection.AddFontFile(AppContext.BaseDirectory)); 131AssertExtensions.Throws<ArgumentException>(null, () => fontCollection.AddFontFile(typeof(Font).Assembly.Location)); 159AssertExtensions.Throws<ArgumentException>(null, () => fontCollection.AddMemoryFont(IntPtr.Zero, 100)); 180AssertExtensions.Throws<ArgumentException>(null, () => fontCollection.AddMemoryFont(fontBuffer, length)); 194AssertExtensions.Throws<ArgumentException>(null, () => fontCollection.AddMemoryFont(10, 100)); 203AssertExtensions.Throws<ArgumentException>(null, () => fontCollection.Families);
System\Drawing\TextureBrushTests.cs (40)
241AssertExtensions.Throws<ArgumentNullException>("image", () => new TextureBrush((Image)null)); 242AssertExtensions.Throws<ArgumentNullException>("image", () => new TextureBrush(null, WrapMode.Tile)); 243AssertExtensions.Throws<ArgumentNullException>("image", () => new TextureBrush(null, RectangleF.Empty)); 244AssertExtensions.Throws<ArgumentNullException>("image", () => new TextureBrush(null, Rectangle.Empty)); 245AssertExtensions.Throws<ArgumentNullException>("image", () => new TextureBrush(null, RectangleF.Empty, null)); 246AssertExtensions.Throws<ArgumentNullException>("image", () => new TextureBrush(null, Rectangle.Empty, null)); 247AssertExtensions.Throws<ArgumentNullException>("image", () => new TextureBrush(null, WrapMode.Tile, RectangleF.Empty)); 248AssertExtensions.Throws<ArgumentNullException>("image", () => new TextureBrush(null, WrapMode.Tile, Rectangle.Empty)); 257AssertExtensions.Throws<ArgumentException>(null, () => new TextureBrush(image)); 258AssertExtensions.Throws<ArgumentException>(null, () => new TextureBrush(image, WrapMode.Tile)); 259AssertExtensions.Throws<ArgumentException>(null, () => new TextureBrush(image, RectangleF.Empty)); 260AssertExtensions.Throws<ArgumentException>(null, () => new TextureBrush(image, Rectangle.Empty)); 261AssertExtensions.Throws<ArgumentException>(null, () => new TextureBrush(image, RectangleF.Empty, null)); 262AssertExtensions.Throws<ArgumentException>(null, () => new TextureBrush(image, Rectangle.Empty, null)); 263AssertExtensions.Throws<ArgumentException>(null, () => new TextureBrush(image, WrapMode.Tile, RectangleF.Empty)); 264AssertExtensions.Throws<ArgumentException>(null, () => new TextureBrush(image, WrapMode.Tile, Rectangle.Empty)); 318AssertExtensions.Throws<ArgumentException>(null, () => brush.Clone()); 328AssertExtensions.Throws<ArgumentException>(null, () => brush.Image); 373AssertExtensions.Throws<ArgumentNullException>("matrix", () => brush.MultiplyTransform(null)); 374AssertExtensions.Throws<ArgumentNullException>("matrix", () => brush.MultiplyTransform(null, MatrixOrder.Prepend)); 383AssertExtensions.Throws<ArgumentException>(null, () => brush.MultiplyTransform(matrix)); 384AssertExtensions.Throws<ArgumentException>(null, () => brush.MultiplyTransform(matrix, MatrixOrder.Prepend)); 427AssertExtensions.Throws<ArgumentException>(null, () => brush.MultiplyTransform(matrix)); 428AssertExtensions.Throws<ArgumentException>(null, () => brush.MultiplyTransform(matrix, MatrixOrder.Prepend)); 453AssertExtensions.Throws<ArgumentException>(null, () => brush.ResetTransform()); 503AssertExtensions.Throws<ArgumentException>(null, () => brush.RotateTransform(10, matrixOrder)); 514AssertExtensions.Throws<ArgumentException>(null, () => brush.RotateTransform(1)); 515AssertExtensions.Throws<ArgumentException>(null, () => brush.RotateTransform(1, MatrixOrder.Prepend)); 567AssertExtensions.Throws<ArgumentException>(null, () => brush.ScaleTransform(1, 2, matrixOrder)); 578AssertExtensions.Throws<ArgumentException>(null, () => brush.ScaleTransform(1, 2)); 579AssertExtensions.Throws<ArgumentException>(null, () => brush.ScaleTransform(1, 2, MatrixOrder.Prepend)); 597AssertExtensions.Throws<ArgumentNullException>("value", () => brush.Transform = null); 608AssertExtensions.Throws<ArgumentException>(null, () => brush.Transform = matrix); 619AssertExtensions.Throws<ArgumentException>(null, () => brush.Transform); 620AssertExtensions.Throws<ArgumentException>(null, () => brush.Transform = matrix); 672AssertExtensions.Throws<ArgumentException>(null, () => brush.TranslateTransform(1, 2, matrixOrder)); 683AssertExtensions.Throws<ArgumentException>(null, () => brush.TranslateTransform(1, 2)); 684AssertExtensions.Throws<ArgumentException>(null, () => brush.TranslateTransform(1, 2, MatrixOrder.Prepend)); 718AssertExtensions.Throws<ArgumentException>(null, () => brush.WrapMode); 719AssertExtensions.Throws<ArgumentException>(null, () => brush.WrapMode = WrapMode.Tile);
System.Windows.Forms.Tests (16)
System\Drawing\Design\PaintValueEventArgsTests.cs (1)
35AssertExtensions.Throws<ArgumentNullException>("graphics", () => new PaintValueEventArgs(null, new object(), null, Rectangle.Empty));
System\Windows\Forms\AccessibleObjects\ComboBox.ComboBoxItemAccessibleObjectTests.cs (11)
594AssertExtensions.True(comboBoxItem1, UIA_PROPERTY_ID.UIA_IsOffscreenPropertyId); // comboBoxItem1 above the visible area 595AssertExtensions.False(comboBoxItem2, UIA_PROPERTY_ID.UIA_IsOffscreenPropertyId); // comboBoxItem2 in the visible area 596AssertExtensions.True(comboBoxItem3, UIA_PROPERTY_ID.UIA_IsOffscreenPropertyId); // comboBoxItem3 below the visible area 613AssertExtensions.True(comboBoxItem1, UIA_PROPERTY_ID.UIA_IsOffscreenPropertyId); // comboBoxItem1 above the visible area 614AssertExtensions.False(comboBoxItem2, UIA_PROPERTY_ID.UIA_IsOffscreenPropertyId); // comboBoxItem2 in the visible area 615AssertExtensions.True(comboBoxItem3, UIA_PROPERTY_ID.UIA_IsOffscreenPropertyId); // comboBoxItem3 below the visible area 630AssertExtensions.True(comboBoxItem1, UIA_PROPERTY_ID.UIA_IsOffscreenPropertyId); 631AssertExtensions.True(comboBoxItem2, UIA_PROPERTY_ID.UIA_IsOffscreenPropertyId); 646AssertExtensions.True(comboBoxItem1, UIA_PROPERTY_ID.UIA_IsOffscreenPropertyId); // comboBoxItem1 above the visible area 647AssertExtensions.False(comboBoxItem2, UIA_PROPERTY_ID.UIA_IsOffscreenPropertyId); // comboBoxItem2 in the visible area 648AssertExtensions.True(comboBoxItem3, UIA_PROPERTY_ID.UIA_IsOffscreenPropertyId); // comboBoxItem3 below the visible area
System\Windows\Forms\ListBoxTests.cs (2)
3277AssertExtensions.Throws<ArgumentException>("value", () => control.SelectedItem = "item"); 3283AssertExtensions.Throws<ArgumentException>("value", () => control.SelectedItem = null);
System\Windows\Forms\Printing\PrintPreviewControl.PrintPreviewControlAccessibilityObjectTests.cs (2)
162AssertExtensions.GreaterThanOrEqualTo((int)scrollProvider.VerticalViewSize, 0); 176AssertExtensions.GreaterThanOrEqualTo((int)scrollProvider.HorizontalViewSize, 0);