27 references to Throws
System.Drawing.Common.Tests (27)
System\Drawing\BitmapTests.cs (6)
79AssertExtensions.Throws<ArgumentException>(paramName, null, () => new Bitmap(filename)); 80AssertExtensions.Throws<ArgumentException>(paramName, null, () => new Bitmap(filename, false)); 81AssertExtensions.Throws<ArgumentException>(paramName, null, () => new Bitmap(filename, true)); 297AssertExtensions.Throws<ArgumentNullException>("g", null, () => new Bitmap(1, 1, null)); 342AssertExtensions.Throws<ArgumentNullException>("original", "image", () => new Bitmap(null, new Size(1, 2))); 343AssertExtensions.Throws<ArgumentNullException>("original", "image", () => new Bitmap(null, 1, 2));
System\Drawing\BufferedGraphicsContextTests.cs (2)
200AssertExtensions.Throws<ArgumentException>("value", null, () => context.MaximumBuffer = new Size(width, 1)); 209AssertExtensions.Throws<ArgumentException>("value", null, () => context.MaximumBuffer = new Size(1, height));
System\Drawing\Drawing2D\HatchBrushTests.cs (2)
52AssertExtensions.Throws<ArgumentException>("hatchstyle", null, () => new HatchBrush(hatchStyle, Color.Empty)); 53AssertExtensions.Throws<ArgumentException>("hatchstyle", null, () => new HatchBrush(hatchStyle, Color.Empty, Color.Empty));
System\Drawing\Drawing2D\LinearGradientBrushTests.cs (2)
333AssertExtensions.Throws<ArgumentException>("value", null, () => brush.Blend = new Blend { Factors = new float[2], Positions = new float[1] }); 586AssertExtensions.Throws<ArgumentNullException>("value", "matrix", () => brush.Transform = null);
System\Drawing\Drawing2D\PathGradientBrushTests.cs (2)
318AssertExtensions.Throws<ArgumentException>("value", null, () => brush.Blend = invalidBlend); 661AssertExtensions.Throws<ArgumentNullException>("value", "matrix", () => brush.Transform = null);
System\Drawing\FontConverterTests.cs (1)
63AssertExtensions.Throws<ArgumentException>(paramName, netfxParamName, () => converter.ConvertFrom(input));
System\Drawing\IconTests.cs (2)
407AssertExtensions.Throws<ArgumentException>("filePath", null, () => Icon.ExtractAssociatedIcon("")); 700AssertExtensions.Throws<ArgumentException>("handle", null, () => Icon.FromHandle(IntPtr.Zero));
System\Drawing\ImageTests.cs (2)
510AssertExtensions.Throws<ArgumentException>("path", null, () => Image.FromFile(string.Empty)); 511AssertExtensions.Throws<ArgumentException>("path", null, () => Image.FromFile(string.Empty, useEmbeddedColorManagement: true));
System\Drawing\Imaging\MetafileTests.cs (5)
87AssertExtensions.Throws<ArgumentException>("path", null, () => new Metafile(path)); 424AssertExtensions.Throws<ArgumentException>("path", null, () => new Metafile(fileName, referenceHdc)); 425AssertExtensions.Throws<ArgumentException>("path", null, () => new Metafile(fileName, referenceHdc, EmfType.EmfOnly)); 426AssertExtensions.Throws<ArgumentException>("path", null, () => new Metafile(fileName, referenceHdc, EmfType.EmfOnly, "description")); 855AssertExtensions.Throws<ArgumentException>("path", null, () => Metafile.GetMetafileHeader(fileName));
System\Drawing\Printing\PaperSizeTests.cs (3)
116AssertExtensions.Throws<ArgumentException>("value", null, () => size.Height = 1); 153AssertExtensions.Throws<ArgumentException>("value", null, () => size.PaperName = "name"); 214AssertExtensions.Throws<ArgumentException>("value", null, () => size.Width = 1);