522 references to Throws
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 (517)
System\Drawing\BitmapTests.cs (61)
69AssertExtensions.Throws<ArgumentNullException>("path", () => new Bitmap((string)null)); 70AssertExtensions.Throws<ArgumentNullException>("path", () => new Bitmap((string)null, false)); 107AssertExtensions.Throws<ArgumentException>(null, () => new Bitmap(type, resource)); 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)); 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)); 768AssertExtensions.Throws<ArgumentException>(null, () => Bitmap.FromHicon(icon.Handle)); 774AssertExtensions.Throws<ArgumentException>(null, () => Bitmap.FromResource(IntPtr.Zero, "Name")); 781AssertExtensions.Throws<ArgumentException>(null, () => Bitmap.FromResource(IntPtr.Zero, "Name")); 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())); 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)); 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 (2)
151AssertExtensions.Throws<ArgumentException>(null, () => context.Allocate(graphics, largeRectangle)); 152AssertExtensions.Throws<ArgumentException>(null, () => context.Allocate(graphics, Rectangle.Empty));
System\Drawing\Drawing2D\CustomLineCapTests.cs (7)
72AssertExtensions.Throws<ArgumentException>(null, () => new CustomLineCap(fillPath, null)); 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);
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 (7)
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])); 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(default, null)); 1742AssertExtensions.Throws<ArgumentNullException>("pen", () => gp.IsOutlineVisible(default(PointF), null));
System\Drawing\Drawing2D\HatchBrushTests.cs (4)
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 (33)
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); 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); 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);
System\Drawing\Drawing2D\MatrixTests.cs (11)
130AssertExtensions.Throws<ArgumentNullException>("plgpts", () => new Matrix(default(RectangleF), null)); 131AssertExtensions.Throws<ArgumentNullException>("plgpts", () => new Matrix(default, null)); 140AssertExtensions.Throws<ArgumentException>(null, () => new Matrix(default, new PointF[length])); 141AssertExtensions.Throws<ArgumentException>(null, () => new Matrix(default, 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); 278AssertExtensions.Throws<ArgumentException>(null, () => CreateDisposedMatrix().IsIdentity); 284AssertExtensions.Throws<ArgumentException>(null, () => CreateDisposedMatrix().IsInvertible); 805AssertExtensions.Throws<ArgumentException>(null, () => matrix.VectorTransformPoints([]));
System\Drawing\Drawing2D\PathGradientBrushTests.cs (17)
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); 240AssertExtensions.Throws<ArgumentException>(null, () => brush.CenterPoint); 292AssertExtensions.Throws<ArgumentException>(null, () => brush.Blend); 309AssertExtensions.Throws<ArgumentException>(null, () => brush.Blend = blend); 568AssertExtensions.Throws<ArgumentException>(null, () => brush.InterpolationColors); 601AssertExtensions.Throws<ArgumentException>(null, () => brush.InterpolationColors = new ColorBlend()); 608AssertExtensions.Throws<ArgumentException>(null, () => 654AssertExtensions.Throws<ArgumentException>(null, () => brush.Transform); 669AssertExtensions.Throws<ArgumentException>(null, () => brush.Transform = nonInvertible); 912AssertExtensions.Throws<ArgumentException>(null, () => brush.FocusScales); 930AssertExtensions.Throws<ArgumentException>(null, () => brush.WrapMode);
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 (48)
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)); 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)); 845AssertExtensions.Throws<ArgumentException>(null, () => font.ToHfont());
System\Drawing\GraphicsTests.Core.cs (3)
19AssertExtensions.Throws<ArgumentException>(null, () => graphics.TransformElements = matrix); 46AssertExtensions.Throws<ArgumentException>(null, () => graphics.TransformElements); 47AssertExtensions.Throws<ArgumentException>(null, () => graphics.TransformElements = Matrix3x2.Identity);
System\Drawing\GraphicsTests.cs (48)
77AssertExtensions.Throws<ArgumentException>(null, () => graphics.GetHdc()); 110AssertExtensions.Throws<ArgumentNullException>("hdc", () => Graphics.FromHdc(IntPtr.Zero)); 258AssertExtensions.Throws<ArgumentNullException>("image", () => Graphics.FromImage(null)); 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); 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); 1853AssertExtensions.Throws<ArgumentException>(null, () => graphics.TransformPoints(destSpace, CoordinateSpace.World, [new(1, 1)])); 1864AssertExtensions.Throws<ArgumentException>(null, () => graphics.TransformPoints(CoordinateSpace.World, srcSpace, [new(1, 1)])); 1910AssertExtensions.Throws<ArgumentException>(null, () => graphics.TransformPoints(CoordinateSpace.Page, CoordinateSpace.Page, [Point.Empty])); 1911AssertExtensions.Throws<ArgumentException>(null, () => graphics.TransformPoints(CoordinateSpace.Page, CoordinateSpace.Page, [PointF.Empty])); 1952AssertExtensions.Throws<ArgumentException>(null, () => graphics.GetNearestColor(Color.Red));
System\Drawing\IconTests.cs (5)
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)); 269AssertExtensions.Throws<ArgumentException>(null, () => new Icon(type, resource)); 592AssertExtensions.Throws<ArgumentOutOfRangeException>(null, icon.ToBitmap);
System\Drawing\ImageTests.cs (13)
112AssertExtensions.Throws<ArgumentException>(null, () => bitmap.GetPropertyItem(propid)); 122AssertExtensions.Throws<ArgumentException>(null, () => bitmap.GetPropertyItem(propid)); 139AssertExtensions.Throws<ArgumentException>(null, () => bitmap.GetPropertyItem(PropertyTagExifUserComment)); 144AssertExtensions.Throws<ArgumentException>(null, () => bitmap.GetPropertyItem(PropertyTagLuminanceTable)); 149AssertExtensions.Throws<ArgumentException>(null, () => bitmap.GetPropertyItem(PropertyTagChrominanceTable)); 159AssertExtensions.Throws<ArgumentException>(null, () => bitmap.GetPropertyItem(PropertyTagExifUserComment)); 164AssertExtensions.Throws<ArgumentException>(null, () => bitmap.GetPropertyItem(PropertyTagLuminanceTable)); 169AssertExtensions.Throws<ArgumentException>(null, () => bitmap.GetPropertyItem(PropertyTagChrominanceTable)); 503AssertExtensions.Throws<ArgumentNullException>("path", () => Image.FromFile(null)); 504AssertExtensions.Throws<ArgumentNullException>("path", () => Image.FromFile(null, 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));
System\Drawing\Imaging\ImageAttributesTests.cs (1)
87AssertExtensions.Throws<ArgumentException>(null, imageAttr.Clone);
System\Drawing\Imaging\MetafileTests.cs (69)
40AssertExtensions.Throws<ArgumentException>(null, () => new Metafile(IntPtr.Zero, false)); 66AssertExtensions.Throws<ArgumentNullException>("path", () => new Metafile((string)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")); 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", () => 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())); 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());
System\Drawing\PensTests.cs (1)
164AssertExtensions.Throws<ArgumentException>(null, () => pen.Color = Color.AliceBlue);
System\Drawing\PenTests.cs (56)
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); 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); 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\PrinterSettingsTests.cs (7)
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);
System\Drawing\RegionTests.cs (40)
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()); 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)); 930AssertExtensions.Throws<ArgumentException>(null, () => Region.FromHrgn(IntPtr.Zero)); 961AssertExtensions.Throws<ArgumentNullException>("g", () => region.GetHrgn(null)); 967AssertExtensions.Throws<ArgumentException>(null, () => CreateDisposedRegion().GetHrgn(s_graphic)); 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)); 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));
System\Drawing\SolidBrushTests.cs (4)
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);
System\Drawing\StringFormatTests.cs (19)
78AssertExtensions.Throws<ArgumentNullException>("format", () => new StringFormat(null)); 87AssertExtensions.Throws<ArgumentException>(null, () => new StringFormat(format)); 122AssertExtensions.Throws<ArgumentException>(null, format.Clone); 170AssertExtensions.Throws<ArgumentException>(null, () => format.SetTabStops(-1, [])); 186AssertExtensions.Throws<ArgumentException>(null, () => format.SetTabStops(0, [])); 195AssertExtensions.Throws<ArgumentException>(null, () => format.GetTabStops(out float firstTabOffset)); 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 (17)
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 (1)
203AssertExtensions.Throws<ArgumentException>(null, () => fontCollection.Families);
System\Drawing\TextureBrushTests.cs (24)
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); 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); 718AssertExtensions.Throws<ArgumentException>(null, () => brush.WrapMode); 719AssertExtensions.Throws<ArgumentException>(null, () => brush.WrapMode = WrapMode.Tile);
System.Windows.Forms.Tests (3)
System\Drawing\Design\PaintValueEventArgsTests.cs (1)
35AssertExtensions.Throws<ArgumentNullException>("graphics", () => new PaintValueEventArgs(null, new object(), null, Rectangle.Empty));
System\Windows\Forms\ListBoxTests.cs (2)
3277AssertExtensions.Throws<ArgumentException>("value", () => control.SelectedItem = "item"); 3283AssertExtensions.Throws<ArgumentException>("value", () => control.SelectedItem = null);