[System] Fix compilation on watchos (#5108)
authorLudovic Henry <ludovic@xamarin.com>
Fri, 23 Jun 2017 23:32:35 +0000 (19:32 -0400)
committerGitHub <noreply@github.com>
Fri, 23 Jun 2017 23:32:35 +0000 (19:32 -0400)
mcs/class/System/System.Net/HttpListenerBasicIdentity.platformnotsupported.cs
mcs/class/System/Test/System.Net/HttpListenerBasicIdentityTest.cs

index 11fc32fb7c68861ad0e8a8e5bdb711aeb67d078f..b83d995b8983d1dc74d0cfc38913a36687c3cf72 100644 (file)
 // 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);
                }
index 4d8985a262d52550c6fe148b185ad247b7677cfc..f998592aad737a2a7ea47fc7fa32ec4d73401a3c 100644 (file)
@@ -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");