From c5639174bfa94fda89096d5da77fa5b931bcdd22 Mon Sep 17 00:00:00 2001 From: Youssef Victor <31348972+Youssef1313@users.noreply.github.com> Date: Wed, 8 Jul 2020 19:54:54 +0200 Subject: [PATCH] Throw with ParamName=value instead of Encoding (#38820) * Throw with ParamName=value instead of Encoding * Update WebClientTest.cs --- src/libraries/System.Net.WebClient/src/System/Net/WebClient.cs | 2 +- src/libraries/System.Net.WebClient/tests/WebClientTest.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libraries/System.Net.WebClient/src/System/Net/WebClient.cs b/src/libraries/System.Net.WebClient/src/System/Net/WebClient.cs index 9a8cfe6..129368a 100644 --- a/src/libraries/System.Net.WebClient/src/System/Net/WebClient.cs +++ b/src/libraries/System.Net.WebClient/src/System/Net/WebClient.cs @@ -143,7 +143,7 @@ namespace System.Net get { return _encoding; } set { - ThrowIfNull(value, nameof(Encoding)); + ThrowIfNull(value, nameof(value)); _encoding = value; } } diff --git a/src/libraries/System.Net.WebClient/tests/WebClientTest.cs b/src/libraries/System.Net.WebClient/tests/WebClientTest.cs index 864a46b..b727562 100644 --- a/src/libraries/System.Net.WebClient/tests/WebClientTest.cs +++ b/src/libraries/System.Net.WebClient/tests/WebClientTest.cs @@ -42,7 +42,7 @@ namespace System.Net.Tests var wc = new WebClient(); AssertExtensions.Throws("value", () => { wc.BaseAddress = "http::/invalid url"; }); - AssertExtensions.Throws("Encoding", () => { wc.Encoding = null; }); + AssertExtensions.Throws("value", () => { wc.Encoding = null; }); } [Fact] -- 2.7.4