2
0
Эх сурвалжийг харах

[System.Net] Tweak tests for watchOS

Bernhard Urban 8 жил өмнө
parent
commit
7777d78b16

+ 31 - 0
mcs/class/System/Test/System.Net.Sockets/SocketTest.cs

@@ -1732,6 +1732,9 @@ namespace MonoTests.System.Net.Sockets
 		}
 
 		[Test]
+#if FEATURE_NO_BSD_SOCKETS
+		[ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
 		public void BeginConnectAddressPortNull ()
 		{
 			var port = NetworkHelpers.FindFreePort ();
@@ -1775,7 +1778,11 @@ namespace MonoTests.System.Net.Sockets
 		}
 		
 		[Test]
+#if FEATURE_NO_BSD_SOCKETS
+		[ExpectedException (typeof (PlatformNotSupportedException))]
+#else
 		[ExpectedException (typeof(ObjectDisposedException))]
+#endif
 		public void BeginConnectAddressPortClosed ()
 		{
 			var port = NetworkHelpers.FindFreePort ();
@@ -1906,6 +1913,9 @@ namespace MonoTests.System.Net.Sockets
 
 
 		[Test]
+#if FEATURE_NO_BSD_SOCKETS
+		[ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
 		public void BeginConnectMultipleNull ()
 		{
 			var port = NetworkHelpers.FindFreePort ();
@@ -1956,7 +1966,11 @@ namespace MonoTests.System.Net.Sockets
 		}
 		
 		[Test]
+#if FEATURE_NO_BSD_SOCKETS
+		[ExpectedException (typeof (PlatformNotSupportedException))]
+#else
 		[ExpectedException (typeof(ObjectDisposedException))]
+#endif
 		public void BeginConnectMultipleClosed ()
 		{
 			var port = NetworkHelpers.FindFreePort ();
@@ -2245,6 +2259,9 @@ namespace MonoTests.System.Net.Sockets
 		}
 
 		[Test]
+#if FEATURE_NO_BSD_SOCKETS
+		[ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
 		public void ConnectAddressPortNull ()
 		{
 			var port = NetworkHelpers.FindFreePort ();
@@ -2287,7 +2304,11 @@ namespace MonoTests.System.Net.Sockets
 		}
 		
 		[Test]
+#if FEATURE_NO_BSD_SOCKETS
+		[ExpectedException (typeof (PlatformNotSupportedException))]
+#else
 		[ExpectedException (typeof(ObjectDisposedException))]
+#endif
 		public void ConnectAddressPortClosed ()
 		{
 			var port = NetworkHelpers.FindFreePort ();
@@ -2396,6 +2417,9 @@ namespace MonoTests.System.Net.Sockets
 		}
 
 		[Test]
+#if FEATURE_NO_BSD_SOCKETS
+		[ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
 		public void ConnectMultipleNull ()
 		{
 			var port = NetworkHelpers.FindFreePort ();
@@ -2444,7 +2468,11 @@ namespace MonoTests.System.Net.Sockets
 		}
 		
 		[Test]
+#if FEATURE_NO_BSD_SOCKETS
+		[ExpectedException (typeof (PlatformNotSupportedException))]
+#else
 		[ExpectedException (typeof(ObjectDisposedException))]
+#endif
 		public void ConnectMultipleClosed ()
 		{
 			var port = NetworkHelpers.FindFreePort ();
@@ -3724,6 +3752,9 @@ namespace MonoTests.System.Net.Sockets
 		// Test case for https://bugzilla.novell.com/show_bug.cgi?id=443346
 		// See also https://bugzilla.xamarin.com/show_bug.cgi?id=52157
 		[Test]
+#if FEATURE_NO_BSD_SOCKETS
+		[ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
 		public void ConnectedProperty ()
 		{
 			var port = NetworkHelpers.FindFreePort ();

+ 3 - 0
mcs/class/System/Test/System.Net/HttpListenerRequestTest.cs

@@ -288,6 +288,9 @@ namespace MonoTests.System.Net
 		}
 
 		[Test]
+#if FEATURE_NO_BSD_SOCKETS
+		[ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
 		public void HttpRequestIgnoreBadCookies ()
 		{
 			var port = NetworkHelpers.FindFreePort ();

+ 3 - 0
mcs/class/System/Test/System.Net/WebClientTest.cs

@@ -43,6 +43,9 @@ namespace MonoTests.System.Net
 		}
 
 		[Test]
+#if FEATURE_NO_BSD_SOCKETS
+		[ExpectedException (typeof (WebException))] // Something catches the PlatformNotSupportedException and re-throws an WebException
+#endif
 		public void DownloadTwice ()
 		{
 			WebClient wc = new WebClient();

+ 3 - 0
mcs/class/System/Test/System.Net/WebClientTestAsync.cs

@@ -79,6 +79,9 @@ namespace MonoTests.System.Net
 		}
 
 		[Test]
+#if FEATURE_NO_BSD_SOCKETS
+		[ExpectedException (typeof (AggregateException))] // Something catches the PlatformNotSupportedException and re-throws an AggregateException
+#endif
 		public void DownloadFileTaskAsync ()
 		{
 			WebClient wc = new WebClient ();