From 8724ace98a8b9781eee5437e5a6c49ea5796db82 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Fri, 23 Jun 2017 19:32:35 -0400 Subject: [PATCH] [System] Fix compilation on watchos (#5108) --- ...HttpListenerBasicIdentity.platformnotsupported.cs | 7 ++++--- .../Test/System.Net/HttpListenerBasicIdentityTest.cs | 12 ++++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/mcs/class/System/System.Net/HttpListenerBasicIdentity.platformnotsupported.cs b/mcs/class/System/System.Net/HttpListenerBasicIdentity.platformnotsupported.cs index 11fc32fb7c6..b83d995b898 100644 --- a/mcs/class/System/System.Net/HttpListenerBasicIdentity.platformnotsupported.cs +++ b/mcs/class/System/System.Net/HttpListenerBasicIdentity.platformnotsupported.cs @@ -24,11 +24,12 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // +using System.Security.Principal; namespace System.Net { - public class HttpListenerBasicIdentity { - internal const string EXCEPTION_MESSAGE = "System.Net.HttpListenerBasicIdentity is not supported on the current platform."; + public class HttpListenerBasicIdentity : GenericIdentity { + const string EXCEPTION_MESSAGE = "System.Net.HttpListenerBasicIdentity is not supported on the current platform."; - public HttpListenerBasicIdentity (string username, string password) + public HttpListenerBasicIdentity (string username, string password) : base (username, "Basic") { throw new PlatformNotSupportedException (EXCEPTION_MESSAGE); } diff --git a/mcs/class/System/Test/System.Net/HttpListenerBasicIdentityTest.cs b/mcs/class/System/Test/System.Net/HttpListenerBasicIdentityTest.cs index 4d8985a262d..f998592aad7 100644 --- a/mcs/class/System/Test/System.Net/HttpListenerBasicIdentityTest.cs +++ b/mcs/class/System/Test/System.Net/HttpListenerBasicIdentityTest.cs @@ -37,12 +37,18 @@ namespace MonoTests.System.Net { [ExpectedException (typeof (ArgumentNullException))] public void Basic1 () { +#if MONOTOUCH_WATCH || __WATCHOS__ + Assert.Ignore ("HttpListenerBasicIdentity is not supported on watchOS"); +#endif HttpListenerBasicIdentity bi = new HttpListenerBasicIdentity (null, null); } [Test] public void Basic2 () { +#if MONOTOUCH_WATCH || __WATCHOS__ + Assert.Ignore ("HttpListenerBasicIdentity is not supported on watchOS"); +#endif HttpListenerBasicIdentity bi = new HttpListenerBasicIdentity ("", null); Assert.AreEqual ("Basic", bi.AuthenticationType, "#01"); Assert.AreEqual ("", bi.Name, "#02"); @@ -53,6 +59,9 @@ namespace MonoTests.System.Net { [Test] public void Basic3 () { +#if MONOTOUCH_WATCH || __WATCHOS__ + Assert.Ignore ("HttpListenerBasicIdentity is not supported on watchOS"); +#endif HttpListenerBasicIdentity bi = new HttpListenerBasicIdentity ("hey", null); Assert.AreEqual ("Basic", bi.AuthenticationType, "#01"); Assert.AreEqual ("hey", bi.Name, "#02"); @@ -63,6 +72,9 @@ namespace MonoTests.System.Net { [Test] public void Basic4 () { +#if MONOTOUCH_WATCH || __WATCHOS__ + Assert.Ignore ("HttpListenerBasicIdentity is not supported on watchOS"); +#endif HttpListenerBasicIdentity bi = new HttpListenerBasicIdentity ("hey", "pass"); Assert.AreEqual ("Basic", bi.AuthenticationType, "#01"); Assert.AreEqual ("hey", bi.Name, "#02"); -- 2.25.1