Skip to content

Commit f519cec

Browse files
committed
Update AsyncTests.cs
Fixed indentation
1 parent 3e6b4e5 commit f519cec

File tree

1 file changed

+47
-47
lines changed

1 file changed

+47
-47
lines changed

RestSharp.IntegrationTests/AsyncTests.cs

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -168,53 +168,53 @@ public void Handles_GET_Request_Errors_TaskAsync_With_Response_Type()
168168
}
169169
}
170170

171-
[Fact]
172-
public void Can_Timeout_GET_TaskAsync()
173-
{
174-
const string baseUrl = "http://localhost:8080/";
175-
using (SimpleServer.Create(baseUrl, Handlers.Generic<ResponseHandler>()))
176-
{
177-
var client = new RestClient(baseUrl);
178-
var request = new RestRequest("timeout", Method.GET).AddBody("Body_Content");
179-
180-
//Half the value of ResponseHandler.Timeout
181-
request.Timeout = 500;
182-
183-
System.AggregateException agg = Assert.Throws<System.AggregateException>(
184-
delegate
185-
{
186-
var task = client.ExecuteTaskAsync(request);
187-
task.Wait();
188-
});
189-
190-
Assert.IsType(typeof(WebException), agg.InnerException);
191-
Assert.Equal("The request timed-out.", agg.InnerException.Message);
192-
}
193-
}
194-
195-
[Fact]
196-
public void Can_Timeout_PUT_TaskAsync()
197-
{
198-
const string baseUrl = "http://localhost:8080/";
199-
using (SimpleServer.Create(baseUrl, Handlers.Generic<ResponseHandler>()))
200-
{
201-
var client = new RestClient(baseUrl);
202-
var request = new RestRequest("timeout", Method.PUT).AddBody("Body_Content");
203-
204-
//Half the value of ResponseHandler.Timeout
205-
request.Timeout = 500;
206-
207-
System.AggregateException agg = Assert.Throws<System.AggregateException>(
208-
delegate
209-
{
210-
var task = client.ExecuteTaskAsync(request);
211-
task.Wait();
212-
});
213-
214-
Assert.IsType(typeof(WebException), agg.InnerException);
215-
Assert.Equal("The request timed-out.", agg.InnerException.Message);
216-
}
217-
}
171+
[Fact]
172+
public void Can_Timeout_GET_TaskAsync()
173+
{
174+
const string baseUrl = "http://localhost:8080/";
175+
using (SimpleServer.Create(baseUrl, Handlers.Generic<ResponseHandler>()))
176+
{
177+
var client = new RestClient(baseUrl);
178+
var request = new RestRequest("timeout", Method.GET).AddBody("Body_Content");
179+
180+
//Half the value of ResponseHandler.Timeout
181+
request.Timeout = 500;
182+
183+
System.AggregateException agg = Assert.Throws<System.AggregateException>(
184+
delegate
185+
{
186+
var task = client.ExecuteTaskAsync(request);
187+
task.Wait();
188+
});
189+
190+
Assert.IsType(typeof(WebException), agg.InnerException);
191+
Assert.Equal("The request timed-out.", agg.InnerException.Message);
192+
}
193+
}
194+
195+
[Fact]
196+
public void Can_Timeout_PUT_TaskAsync()
197+
{
198+
const string baseUrl = "http://localhost:8080/";
199+
using (SimpleServer.Create(baseUrl, Handlers.Generic<ResponseHandler>()))
200+
{
201+
var client = new RestClient(baseUrl);
202+
var request = new RestRequest("timeout", Method.PUT).AddBody("Body_Content");
203+
204+
//Half the value of ResponseHandler.Timeout
205+
request.Timeout = 500;
206+
207+
System.AggregateException agg = Assert.Throws<System.AggregateException>(
208+
delegate
209+
{
210+
var task = client.ExecuteTaskAsync(request);
211+
task.Wait();
212+
});
213+
214+
Assert.IsType(typeof(WebException), agg.InnerException);
215+
Assert.Equal("The request timed-out.", agg.InnerException.Message);
216+
}
217+
}
218218

219219
void UrlToStatusCodeHandler(HttpListenerContext obj)
220220
{

0 commit comments

Comments
 (0)