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