Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update AsyncTests.cs

Fixed indentation
  • Loading branch information...
commit f519cec96d6d3fd761711075bf02070a8e661387 1 parent 3e6b4e5
rggardner rggardner authored
Showing with 47 additions and 47 deletions.
  1. +47 −47 RestSharp.IntegrationTests/AsyncTests.cs
94 RestSharp.IntegrationTests/AsyncTests.cs
View
@@ -168,53 +168,53 @@ public void Handles_GET_Request_Errors_TaskAsync_With_Response_Type()
}
}
- [Fact]
- public void Can_Timeout_GET_TaskAsync()
- {
- const string baseUrl = "http://localhost:8080/";
- using (SimpleServer.Create(baseUrl, Handlers.Generic<ResponseHandler>()))
- {
- var client = new RestClient(baseUrl);
- var request = new RestRequest("timeout", Method.GET).AddBody("Body_Content");
-
- //Half the value of ResponseHandler.Timeout
- request.Timeout = 500;
-
- System.AggregateException agg = Assert.Throws<System.AggregateException>(
- delegate
- {
- var task = client.ExecuteTaskAsync(request);
- task.Wait();
- });
-
- Assert.IsType(typeof(WebException), agg.InnerException);
- Assert.Equal("The request timed-out.", agg.InnerException.Message);
- }
- }
-
- [Fact]
- public void Can_Timeout_PUT_TaskAsync()
- {
- const string baseUrl = "http://localhost:8080/";
- using (SimpleServer.Create(baseUrl, Handlers.Generic<ResponseHandler>()))
- {
- var client = new RestClient(baseUrl);
- var request = new RestRequest("timeout", Method.PUT).AddBody("Body_Content");
-
- //Half the value of ResponseHandler.Timeout
- request.Timeout = 500;
-
- System.AggregateException agg = Assert.Throws<System.AggregateException>(
- delegate
- {
- var task = client.ExecuteTaskAsync(request);
- task.Wait();
- });
-
- Assert.IsType(typeof(WebException), agg.InnerException);
- Assert.Equal("The request timed-out.", agg.InnerException.Message);
- }
- }
+ [Fact]
+ public void Can_Timeout_GET_TaskAsync()
+ {
+ const string baseUrl = "http://localhost:8080/";
+ using (SimpleServer.Create(baseUrl, Handlers.Generic<ResponseHandler>()))
+ {
+ var client = new RestClient(baseUrl);
+ var request = new RestRequest("timeout", Method.GET).AddBody("Body_Content");
+
+ //Half the value of ResponseHandler.Timeout
+ request.Timeout = 500;
+
+ System.AggregateException agg = Assert.Throws<System.AggregateException>(
+ delegate
+ {
+ var task = client.ExecuteTaskAsync(request);
+ task.Wait();
+ });
+
+ Assert.IsType(typeof(WebException), agg.InnerException);
+ Assert.Equal("The request timed-out.", agg.InnerException.Message);
+ }
+ }
+
+ [Fact]
+ public void Can_Timeout_PUT_TaskAsync()
+ {
+ const string baseUrl = "http://localhost:8080/";
+ using (SimpleServer.Create(baseUrl, Handlers.Generic<ResponseHandler>()))
+ {
+ var client = new RestClient(baseUrl);
+ var request = new RestRequest("timeout", Method.PUT).AddBody("Body_Content");
+
+ //Half the value of ResponseHandler.Timeout
+ request.Timeout = 500;
+
+ System.AggregateException agg = Assert.Throws<System.AggregateException>(
+ delegate
+ {
+ var task = client.ExecuteTaskAsync(request);
+ task.Wait();
+ });
+
+ Assert.IsType(typeof(WebException), agg.InnerException);
+ Assert.Equal("The request timed-out.", agg.InnerException.Message);
+ }
+ }
void UrlToStatusCodeHandler(HttpListenerContext obj)
{
Please sign in to comment.
Something went wrong with that request. Please try again.