Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThays Grazia <thaystg@gmail.com>2019-10-19 04:23:44 +0300
committerSteve Pfister <steveisok@users.noreply.github.com>2019-10-19 04:23:44 +0300
commit105ead870774ad116c8afc5352de1e1637301e2f (patch)
tree95aa706c56a8bb73d1fd9f81dbe5155059809676 /mcs/class/System.Net.Http
parentd8ae32a9ee7763c861bdc31831271d82aa8a4953 (diff)
Changing behavior of some tests in WatchOs
Needs this ifdefs because of this https://github.com/mono/mono/pull/17260. (#17423)
Diffstat (limited to 'mcs/class/System.Net.Http')
-rw-r--r--mcs/class/System.Net.Http/Test/System.Net.Http.Headers/HttpHeaderValueCollection.cs4
-rw-r--r--mcs/class/System.Net.Http/Test/System.Net.Http.Headers/HttpHeadersTest.cs2
-rw-r--r--mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs4
-rw-r--r--mcs/class/System.Net.Http/Test/System.Net.Http/HttpRequestMessageTest.cs8
-rw-r--r--mcs/class/System.Net.Http/Test/System.Net.Http/HttpResponseMessageTest.cs4
5 files changed, 22 insertions, 0 deletions
diff --git a/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/HttpHeaderValueCollection.cs b/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/HttpHeaderValueCollection.cs
index 2afccf21c1b..9a4e255094d 100644
--- a/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/HttpHeaderValueCollection.cs
+++ b/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/HttpHeaderValueCollection.cs
@@ -120,10 +120,14 @@ namespace MonoTests.System.Net.Http.Headers
headers.TryAddWithoutValidation("User-Agent", "agent2/2.0");
Assert.AreEqual (1, headers.UserAgent.Count, "#1");
+#if !__WATCHOS__
if (HttpClientTestHelpers.UsingSocketsHandler)
+#endif
Assert.AreEqual ("agent2/2.0 user,agent/1.0", headers.UserAgent.ToString (), "#2");
+#if !__WATCHOS__
else
Assert.AreEqual ("agent2/2.0user,agent/1.0", headers.UserAgent.ToString (), "#2");
+#endif
Assert.AreEqual ("User-Agent: agent2/2.0 user,agent/1.0\r\n", headers.ToString (), "#3");
diff --git a/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/HttpHeadersTest.cs b/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/HttpHeadersTest.cs
index bfabf4ee6a7..5bb8d86b728 100644
--- a/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/HttpHeadersTest.cs
+++ b/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/HttpHeadersTest.cs
@@ -61,8 +61,10 @@ namespace MonoTests.System.Net.Http.Headers
if (HttpClientTestHelpers.UsingSocketsHandler)
Assert.Fail ("#1");
} catch (FormatException) {
+#if !__WATCHOS__
if (!HttpClientTestHelpers.UsingSocketsHandler)
throw;
+#endif
}
}
diff --git a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs
index 402be6aa876..441730d1dcd 100644
--- a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs
+++ b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs
@@ -189,7 +189,9 @@ namespace MonoTests.System.Net.Http
[Test]
#if FEATURE_NO_BSD_SOCKETS
+#if !__WATCHOS__
[ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
#endif
public void Ctor_HttpClientHandler ()
{
@@ -1109,7 +1111,9 @@ namespace MonoTests.System.Net.Http
[Test]
#if FEATURE_NO_BSD_SOCKETS
+#if !__WATCHOS__
[ExpectedException (typeof (PlatformNotSupportedException))]
+#endif
#endif
public void Send_Invalid ()
{
diff --git a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpRequestMessageTest.cs b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpRequestMessageTest.cs
index 735fe2919dd..2eb17563a0e 100644
--- a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpRequestMessageTest.cs
+++ b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpRequestMessageTest.cs
@@ -61,13 +61,17 @@ namespace MonoTests.System.Net.Http
Assert.AreEqual (HttpMethod.Get, m.Method, "#3");
Assert.IsNotNull (m.Properties, "#4");
Assert.IsNull (m.RequestUri, "#5");
+#if !__WATCHOS__
if (HttpClientTestHelpers.UsingSocketsHandler) {
+#endif
Assert.AreEqual (new Version (2, 0), m.Version, "#6");
Assert.AreEqual ("Method: GET, RequestUri: '<null>', Version: 2.0, Content: <null>, Headers:\r\n{\r\n}", m.ToString (), "#7");
+#if !__WATCHOS__
} else {
Assert.AreEqual (new Version (1, 1), m.Version, "#6");
Assert.AreEqual ("Method: GET, RequestUri: '<null>', Version: 1.1, Content: <null>, Headers:\r\n{\r\n}", m.ToString (), "#7");
}
+#endif
}
[Test]
@@ -670,10 +674,14 @@ namespace MonoTests.System.Net.Http
// .NET encloses the "Age: vv" with two whitespaces.
var normalized = Regex.Replace (message.ToString (), @"\s", "");
+#if !__WATCHOS__
if (HttpClientTestHelpers.UsingSocketsHandler)
+#endif
Assert.AreEqual ("Method:GET,RequestUri:'<null>',Version:2.0,Content:<null>,Headers:{Age:vv}", normalized, "#3");
+#if !__WATCHOS__
else
Assert.AreEqual ("Method:GET,RequestUri:'<null>',Version:1.1,Content:<null>,Headers:{Age:vv}", normalized, "#3");
+#endif
}
[Test]
diff --git a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpResponseMessageTest.cs b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpResponseMessageTest.cs
index 0ed45c14c6e..df2a781bdc1 100644
--- a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpResponseMessageTest.cs
+++ b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpResponseMessageTest.cs
@@ -275,10 +275,14 @@ namespace MonoTests.System.Net.Http
Assert.AreEqual ("v1", values[0]);
break;
case 1:
+#if !__WATCHOS__
if (HttpClientTestHelpers.UsingSocketsHandler)
+#endif
Assert.AreEqual ("Cache-Control", entry.Key);
+#if !__WATCHOS__
else
Assert.AreEqual ("cache-control", entry.Key);
+#endif
values = entry.Value.ToList ();
Assert.AreEqual (1, values.Count);
Assert.AreEqual ("audio", values[0]);