From 2d8c950896eb8d75657d065c280f7d5f34e0688d Mon Sep 17 00:00:00 2001 From: Youssef1313 <31348972+Youssef1313@users.noreply.github.com> Date: Wed, 3 Jul 2019 19:57:56 +0200 Subject: [PATCH] Fix argument name & use nameof instead of magic string (dotnet/corefx#39154) * Fix argument name & use nameof instead of magic string * Update GraphicsTests.cs Commit migrated from https://github.com/dotnet/corefx/commit/bb7e8b542f5f16ce5497097bbc2b26d77c601dbe --- .../System.Drawing.Common/src/System/Drawing/Graphics.Unix.cs | 4 ++-- src/libraries/System.Drawing.Common/tests/GraphicsTests.cs | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/Graphics.Unix.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/Graphics.Unix.cs index f0ffd19..1582fc5 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/Graphics.Unix.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/Graphics.Unix.cs @@ -1104,7 +1104,7 @@ namespace System.Drawing public void DrawRectangles(Pen pen, RectangleF[] rects) { if (pen == null) - throw new ArgumentNullException("image"); + throw new ArgumentNullException(nameof(pen)); if (rects == null) throw new ArgumentNullException(nameof(rects)); int status = Gdip.GdipDrawRectangles(NativeGraphics, pen.NativePen, rects, rects.Length); @@ -1114,7 +1114,7 @@ namespace System.Drawing public void DrawRectangles(Pen pen, Rectangle[] rects) { if (pen == null) - throw new ArgumentNullException("image"); + throw new ArgumentNullException(nameof(pen)); if (rects == null) throw new ArgumentNullException(nameof(rects)); int status = Gdip.GdipDrawRectanglesI(NativeGraphics, pen.NativePen, rects, rects.Length); diff --git a/src/libraries/System.Drawing.Common/tests/GraphicsTests.cs b/src/libraries/System.Drawing.Common/tests/GraphicsTests.cs index 4275db2..26fed28 100644 --- a/src/libraries/System.Drawing.Common/tests/GraphicsTests.cs +++ b/src/libraries/System.Drawing.Common/tests/GraphicsTests.cs @@ -2441,7 +2441,6 @@ namespace System.Drawing.Tests } } - [ActiveIssue(20884, TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void DrawRectangles_NullPen_ThrowsArgumentNullException() { -- 2.7.4