Merge branch 'patch-1' of https://github.com/ReubenBond/mono into ReubenBond-patch-1
[mono.git] / mcs / class / System / Test / System.Net.WebSockets / ClientWebSocketTest.cs
index 7c89da6ef7158c11e5eb40427e2df607c1d3158e..a990f67e65848183a4c9ac8d2c50060406987d95 100644 (file)
@@ -49,7 +49,10 @@ namespace MonoTests.System.Net.WebSockets
                [Test]
                public void ServerHandshakeReturnCrapStatusCodeTest ()
                {
+                       // On purpose, 
+                       #pragma warning disable 4014
                        HandleHttpRequestAsync ((req, resp) => resp.StatusCode = 418);
+                       #pragma warning restore 4014
                        try {
                                Assert.IsTrue (socket.ConnectAsync (new Uri ("ws://localhost:" + Port), CancellationToken.None).Wait (5000));
                        } catch (AggregateException e) {
@@ -62,10 +65,12 @@ namespace MonoTests.System.Net.WebSockets
                [Test]
                public void ServerHandshakeReturnWrongUpgradeHeader ()
                {
+                       #pragma warning disable 4014
                        HandleHttpRequestAsync ((req, resp) => {
                                        resp.StatusCode = 101;
                                        resp.Headers["Upgrade"] = "gtfo";
                                });
+                       #pragma warning restore 4014
                        try {
                                Assert.IsTrue (socket.ConnectAsync (new Uri ("ws://localhost:" + Port), CancellationToken.None).Wait (5000));
                        } catch (AggregateException e) {
@@ -78,12 +83,14 @@ namespace MonoTests.System.Net.WebSockets
                [Test]
                public void ServerHandshakeReturnWrongConnectionHeader ()
                {
+                       #pragma warning disable 4014
                        HandleHttpRequestAsync ((req, resp) => {
                                        resp.StatusCode = 101;
                                        resp.Headers["Upgrade"] = "websocket";
                                        // Mono http request doesn't like the forcing, test still valid since the default connection header value is empty
                                        //ForceSetHeader (resp.Headers, "Connection", "Foo");
                                });
+                       #pragma warning restore 4014
                        try {
                                Assert.IsTrue (socket.ConnectAsync (new Uri ("ws://localhost:" + Port), CancellationToken.None).Wait (5000));
                        } catch (AggregateException e) {