namespace MonoTests.System.Net
{
[TestFixture]
- [Category ("RequiresBSDSockets")]
public class WebClientTest
{
private string _tempFolder;
[Test]
[Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void UploadValues1 ()
{
IPEndPoint ep = NetworkHelpers.LocalEphemeralEndPoint ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ // We throw a PlatformNotSupportedException deeper, which is caught and re-thrown as WebException
+ [ExpectedException (typeof (WebException))]
+#endif
public void GetWebRequestOverriding ()
{
GetWebRequestOverridingTestClass testObject = new GetWebRequestOverridingTestClass ();
}
[Test]
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void DefaultProxy ()
{
WebClient wc = new WebClient ();
Assert.AreSame (wc.Proxy, WebRequest.DefaultWebProxy);
}
-#if NET_4_5
[Test]
[Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void UploadStringAsyncCancelEvent ()
{
UploadAsyncCancelEventTest (9301, (webClient, uri, cancelEvent) =>
[Test]
[Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void UploadDataAsyncCancelEvent ()
{
UploadAsyncCancelEventTest (9302, (webClient, uri, cancelEvent) =>
[Test]
[Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void UploadValuesAsyncCancelEvent ()
{
UploadAsyncCancelEventTest (9303, (webClient, uri, cancelEvent) =>
[Test]
[Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void UploadFileAsyncCancelEvent ()
{
UploadAsyncCancelEventTest (9304,(webClient, uri, cancelEvent) =>
[Test]
[Category ("AndroidNotWorking")] // Test suite hangs if the tests runs as part of the entire BCL suite. Works when only this fixture is ran
+#if FEATURE_NO_BSD_SOCKETS
+ [ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
public void UploadFileAsyncContentType ()
{
var port = NetworkHelpers.FindFreePort ();
}
listener.Close ();
}
-#endif
public void UploadAsyncCancelEventTest (int port, Action<WebClient, Uri, EventWaitHandle> uploadAction)
{