[System*] Throw a PlatformNotSupported exception when using the networking stack...
[mono.git] / mcs / class / System / Test / System.Net / HttpWebResponseTest.cs
index 10d7d807444ce7527e56c73b601788be68f08664..b2c8e90488c059be03460d907142b53827d3a03f 100644 (file)
@@ -21,10 +21,12 @@ using NUnit.Framework;
 namespace MonoTests.System.Net
 {
        [TestFixture]
-       [Category ("RequiresBSDSockets")]
        public class HttpWebResponseTest
        {
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void CharacterSet_Disposed ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -53,6 +55,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Close_Disposed ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -72,6 +77,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ContentEncoding_Disposed ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -100,6 +108,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ContentLength_Disposed ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -120,6 +131,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ContentType_Disposed ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -148,6 +162,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Cookies_Disposed ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -186,6 +203,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void GetResponseHeader_Disposed ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -214,6 +234,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void GetResponseStream_Disposed ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -242,6 +265,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Headers_Disposed ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -269,6 +295,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void LastModified_Disposed ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -297,6 +326,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Method_Disposed ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -325,6 +357,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ProtocolVersion_Disposed ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -353,6 +388,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ResponseUri_Disposed ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -381,6 +419,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Server_Disposed ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -409,6 +450,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void StatusCode_Disposed ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -429,6 +473,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void StatusDescription_Disposed ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -477,10 +524,12 @@ namespace MonoTests.System.Net
        }
 
        [TestFixture]
-       [Category ("RequiresBSDSockets")]
        public class HttpResponseStreamTest
        {
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void BeginRead_Buffer_Null ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -530,6 +579,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void BeginWrite ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -590,6 +642,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void CanSeek ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -617,6 +672,9 @@ namespace MonoTests.System.Net
                }
 
                [Test] // bug #324182
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void CanTimeout ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -644,6 +702,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void CanWrite ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -671,6 +732,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Read ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -708,6 +772,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Read_Buffer_Null ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -757,6 +824,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Read_Count_Negative ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -807,6 +877,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Read_Count_Overflow ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -857,6 +930,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Read_Offset_Negative ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -907,6 +983,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Read_Offset_Overflow ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -1021,6 +1100,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void ReadTimeout ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -1048,6 +1130,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void Write ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();
@@ -1080,6 +1165,9 @@ namespace MonoTests.System.Net
                }
 
                [Test]
+#if FEATURE_NO_BSD_SOCKETS
+               [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
                public void WriteTimeout ()
                {
                        IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint();