[System*] Throw a PlatformNotSupported exception when using the networking stack...
[mono.git] / mcs / class / System / Test / System.Net / DnsTest.cs
index e06ca4bf5d6ae6e16ca43665f144953ba1d2b1c0..fef014541882d3011f1d7bbcd4ea466b8161c2f3 100644 (file)
@@ -19,7 +19,6 @@ using NUnit.Framework;
 namespace MonoTests.System.Net\r
 {\r
        [TestFixture]\r
-       [Category ("RequiresBSDSockets")]\r
        public class DnsTest\r
        {\r
                private String site1Name = "google-public-dns-a.google.com",\r
@@ -30,6 +29,9 @@ namespace MonoTests.System.Net
                private uint site1IP = 134744072, site2IP = 134743044; // Big-Endian\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void AsyncGetHostByName ()\r
                {\r
                        IAsyncResult async = Dns.BeginGetHostByName (site1Name, null, null);\r
@@ -39,6 +41,9 @@ namespace MonoTests.System.Net
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void AsyncGetHostByNameCallback ()\r
                {\r
                        var evt = new ManualResetEvent (false);\r
@@ -61,6 +66,9 @@ namespace MonoTests.System.Net
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void AsyncResolve ()\r
                {\r
                        IAsyncResult async = Dns.BeginResolve (site1Dot, null, null);\r
@@ -71,6 +79,9 @@ namespace MonoTests.System.Net
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void AsyncResolveCallback ()\r
                {\r
                        var evt = new ManualResetEvent (false);\r
@@ -205,6 +216,9 @@ namespace MonoTests.System.Net
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void GetHostByName ()\r
                {\r
                        SubTestGetHostByName (site1Name, site1Dot);\r
@@ -336,6 +350,9 @@ namespace MonoTests.System.Net
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void BeginResolve_HostName_Null ()\r
                {\r
                        try {\r
@@ -352,6 +369,9 @@ namespace MonoTests.System.Net
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void Resolve ()\r
                {\r
                        SubTestResolve (site1Name);\r
@@ -367,6 +387,9 @@ namespace MonoTests.System.Net
                }\r
 \r
                [Test]\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void Resolve_HostName_Null ()\r
                {\r
                        try {\r
@@ -381,6 +404,9 @@ namespace MonoTests.System.Net
                }\r
 \r
                [Test] // BeginGetHostEntry (IPAddress, AsyncCallback, Object)\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void BeginGetHostEntry1_Address_Null ()\r
                {\r
                        try {\r
@@ -398,6 +424,9 @@ namespace MonoTests.System.Net
                }\r
 \r
                [Test] // BeginGetHostEntry (String, AsyncCallback, Object)\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void BeginGetHostEntry2_HostNameOrAddress_Null ()\r
                {\r
                        try {\r
@@ -415,6 +444,9 @@ namespace MonoTests.System.Net
                }\r
 \r
                [Test] // BeginGetHostEntry (String, AsyncCallback, Object)\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void BeginGetHostEntry2_HostNameOrAddress_UnspecifiedAddress ()\r
                {\r
                        // IPv4\r
@@ -473,6 +505,9 @@ namespace MonoTests.System.Net
                }\r
 \r
                [Test] // GetHostEntry (String)\r
+#if FEATURE_NO_BSD_SOCKETS\r
+               [ExpectedException (typeof (PlatformNotSupportedException))]\r
+#endif\r
                public void GetHostEntry2 ()\r
                {\r
                        Dns.GetHostEntry (site1Name); // hostname\r