Merge pull request #3591 from directhex/mono_libdir_fallback
[mono.git] / mcs / class / System / Test / System.Net / ServicePointManagerTest.cs
index 58d12cc6d22c1fb1cba73e68ec48a0b74c4f2f26..b6808979e4a2d77c8cfce2252e67568d7466a333 100644 (file)
@@ -19,7 +19,7 @@ namespace MonoTests.System.Net
 {\r
 \r
 [TestFixture]\r
-public class ServicePointManagerTest : Assertion\r
+public class ServicePointManagerTest\r
 {\r
        private Uri googleUri;\r
        private Uri yahooUri;\r
@@ -29,8 +29,10 @@ public class ServicePointManagerTest : Assertion
        [SetUp]\r
         public void GetReady () \r
        {\r
+#if !FEATURE_NO_BSD_SOCKETS\r
                maxIdle = ServicePointManager.MaxServicePointIdleTime;\r
                ServicePointManager.MaxServicePointIdleTime = 10;\r
+#endif\r
                googleUri = new Uri ("http://www.google.com");\r
                yahooUri = new Uri ("http://www.yahoo.com");\r
                apacheUri = new Uri ("http://www.apache.org");\r
@@ -39,14 +41,16 @@ public class ServicePointManagerTest : Assertion
        [TearDown]\r
        public void Finish ()\r
        {\r
+#if !FEATURE_NO_BSD_SOCKETS\r
                ServicePointManager.MaxServicePointIdleTime = maxIdle;\r
+#endif\r
        }\r
 \r
         [Test, ExpectedException (typeof (InvalidOperationException))]\r
                [Category ("InetAccess")]\r
         public void MaxServicePointManagers ()\r
         {\r
-               AssertEquals ("#1", 0, ServicePointManager.MaxServicePoints);\r
+               Assert.AreEqual (0, ServicePointManager.MaxServicePoints, "#1");\r
                \r
                DoWebRequest (googleUri);\r
                Thread.Sleep (100);\r
@@ -82,13 +86,20 @@ public class ServicePointManagerTest : Assertion
        }\r
        \r
         [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+       [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
        public void FindServicePoint ()\r
        {\r
                ServicePointManager.MaxServicePoints = 0;\r
                ServicePoint sp = ServicePointManager.FindServicePoint (googleUri, new WebProxy (apacheUri));\r
-               AssertEquals ("#1", apacheUri, sp.Address);\r
-               AssertEquals ("#2", 2, sp.ConnectionLimit);\r
-               AssertEquals ("#3", "http", sp.ConnectionName);\r
+               Assert.AreEqual (apacheUri, sp.Address, "#1");\r
+#if MOBILE && !MONODROID\r
+               Assert.AreEqual (10, sp.ConnectionLimit, "#2");\r
+#else\r
+               Assert.AreEqual (2, sp.ConnectionLimit, "#2");\r
+#endif\r
+               Assert.AreEqual ("http", sp.ConnectionName, "#3");\r
        }\r
        \r
        private void DoWebRequest (Uri uri)\r