@@ -18,15 +18,15 @@ public void Can_Not_Be_Added_To_GET_Request()
18
18
19
19
using ( SimpleServer . Create ( BASE_URL , Handlers . Generic < RequestBodyCapturer > ( ) ) )
20
20
{
21
- var client = new RestClient ( BASE_URL ) ;
22
- var request = new RestRequest ( RequestBodyCapturer . RESOURCE , httpMethod ) ;
21
+ RestClient client = new RestClient ( BASE_URL ) ;
22
+ RestRequest request = new RestRequest ( RequestBodyCapturer . RESOURCE , httpMethod ) ;
23
23
24
24
const string contentType = "text/plain" ;
25
25
const string bodyData = "abc123 foo bar baz BING!" ;
26
26
27
27
request . AddParameter ( contentType , bodyData , ParameterType . RequestBody ) ;
28
28
29
- var resetEvent = new ManualResetEvent ( false ) ;
29
+ ManualResetEvent resetEvent = new ManualResetEvent ( false ) ;
30
30
31
31
client . ExecuteAsync ( request , response => resetEvent . Set ( ) ) ;
32
32
resetEvent . WaitOne ( ) ;
@@ -42,10 +42,9 @@ public void Can_Have_No_Body_Added_To_POST_Request()
42
42
43
43
using ( SimpleServer . Create ( BASE_URL , Handlers . Generic < RequestBodyCapturer > ( ) ) )
44
44
{
45
- var client = new RestClient ( BASE_URL ) ;
46
- var request = new RestRequest ( RequestBodyCapturer . RESOURCE , httpMethod ) ;
47
-
48
- var resetEvent = new ManualResetEvent ( false ) ;
45
+ RestClient client = new RestClient ( BASE_URL ) ;
46
+ RestRequest request = new RestRequest ( RequestBodyCapturer . RESOURCE , httpMethod ) ;
47
+ ManualResetEvent resetEvent = new ManualResetEvent ( false ) ;
49
48
50
49
client . ExecuteAsync ( request , response => resetEvent . Set ( ) ) ;
51
50
resetEvent . WaitOne ( ) ;
@@ -61,15 +60,15 @@ public void Can_Be_Added_To_POST_Request()
61
60
62
61
using ( SimpleServer . Create ( BASE_URL , Handlers . Generic < RequestBodyCapturer > ( ) ) )
63
62
{
64
- var client = new RestClient ( BASE_URL ) ;
65
- var request = new RestRequest ( RequestBodyCapturer . RESOURCE , httpMethod ) ;
63
+ RestClient client = new RestClient ( BASE_URL ) ;
64
+ RestRequest request = new RestRequest ( RequestBodyCapturer . RESOURCE , httpMethod ) ;
66
65
67
66
const string contentType = "text/plain" ;
68
67
const string bodyData = "abc123 foo bar baz BING!" ;
69
68
70
69
request . AddParameter ( contentType , bodyData , ParameterType . RequestBody ) ;
71
70
72
- var resetEvent = new ManualResetEvent ( false ) ;
71
+ ManualResetEvent resetEvent = new ManualResetEvent ( false ) ;
73
72
74
73
client . ExecuteAsync ( request , response => resetEvent . Set ( ) ) ;
75
74
resetEvent . WaitOne ( ) ;
@@ -85,15 +84,15 @@ public void Can_Be_Added_To_PUT_Request()
85
84
86
85
using ( SimpleServer . Create ( BASE_URL , Handlers . Generic < RequestBodyCapturer > ( ) ) )
87
86
{
88
- var client = new RestClient ( BASE_URL ) ;
89
- var request = new RestRequest ( RequestBodyCapturer . RESOURCE , httpMethod ) ;
87
+ RestClient client = new RestClient ( BASE_URL ) ;
88
+ RestRequest request = new RestRequest ( RequestBodyCapturer . RESOURCE , httpMethod ) ;
90
89
91
90
const string contentType = "text/plain" ;
92
91
const string bodyData = "abc123 foo bar baz BING!" ;
93
92
94
93
request . AddParameter ( contentType , bodyData , ParameterType . RequestBody ) ;
95
94
96
- var resetEvent = new ManualResetEvent ( false ) ;
95
+ ManualResetEvent resetEvent = new ManualResetEvent ( false ) ;
97
96
98
97
client . ExecuteAsync ( request , response => resetEvent . Set ( ) ) ;
99
98
resetEvent . WaitOne ( ) ;
@@ -109,15 +108,15 @@ public void Can_Be_Added_To_DELETE_Request()
109
108
110
109
using ( SimpleServer . Create ( BASE_URL , Handlers . Generic < RequestBodyCapturer > ( ) ) )
111
110
{
112
- var client = new RestClient ( BASE_URL ) ;
113
- var request = new RestRequest ( RequestBodyCapturer . RESOURCE , httpMethod ) ;
111
+ RestClient client = new RestClient ( BASE_URL ) ;
112
+ RestRequest request = new RestRequest ( RequestBodyCapturer . RESOURCE , httpMethod ) ;
114
113
115
114
const string contentType = "text/plain" ;
116
115
const string bodyData = "abc123 foo bar baz BING!" ;
117
116
118
117
request . AddParameter ( contentType , bodyData , ParameterType . RequestBody ) ;
119
118
120
- var resetEvent = new ManualResetEvent ( false ) ;
119
+ ManualResetEvent resetEvent = new ManualResetEvent ( false ) ;
121
120
122
121
client . ExecuteAsync ( request , response => resetEvent . Set ( ) ) ;
123
122
resetEvent . WaitOne ( ) ;
@@ -133,15 +132,15 @@ public void Can_Not_Be_Added_To_HEAD_Request()
133
132
134
133
using ( SimpleServer . Create ( BASE_URL , Handlers . Generic < RequestBodyCapturer > ( ) ) )
135
134
{
136
- var client = new RestClient ( BASE_URL ) ;
137
- var request = new RestRequest ( RequestBodyCapturer . RESOURCE , httpMethod ) ;
135
+ RestClient client = new RestClient ( BASE_URL ) ;
136
+ RestRequest request = new RestRequest ( RequestBodyCapturer . RESOURCE , httpMethod ) ;
138
137
139
138
const string contentType = "text/plain" ;
140
139
const string bodyData = "abc123 foo bar baz BING!" ;
141
140
142
141
request . AddParameter ( contentType , bodyData , ParameterType . RequestBody ) ;
143
142
144
- var resetEvent = new ManualResetEvent ( false ) ;
143
+ ManualResetEvent resetEvent = new ManualResetEvent ( false ) ;
145
144
146
145
client . ExecuteAsync ( request , response => resetEvent . Set ( ) ) ;
147
146
resetEvent . WaitOne ( ) ;
@@ -157,15 +156,15 @@ public void Can_Be_Added_To_OPTIONS_Request()
157
156
158
157
using ( SimpleServer . Create ( BASE_URL , Handlers . Generic < RequestBodyCapturer > ( ) ) )
159
158
{
160
- var client = new RestClient ( BASE_URL ) ;
161
- var request = new RestRequest ( RequestBodyCapturer . RESOURCE , httpMethod ) ;
159
+ RestClient client = new RestClient ( BASE_URL ) ;
160
+ RestRequest request = new RestRequest ( RequestBodyCapturer . RESOURCE , httpMethod ) ;
162
161
163
162
const string contentType = "text/plain" ;
164
163
const string bodyData = "abc123 foo bar baz BING!" ;
165
164
166
165
request . AddParameter ( contentType , bodyData , ParameterType . RequestBody ) ;
167
166
168
- var resetEvent = new ManualResetEvent ( false ) ;
167
+ ManualResetEvent resetEvent = new ManualResetEvent ( false ) ;
169
168
170
169
client . ExecuteAsync ( request , response => resetEvent . Set ( ) ) ;
171
170
resetEvent . WaitOne ( ) ;
@@ -181,15 +180,15 @@ public void Can_Be_Added_To_PATCH_Request()
181
180
182
181
using ( SimpleServer . Create ( BASE_URL , Handlers . Generic < RequestBodyCapturer > ( ) ) )
183
182
{
184
- var client = new RestClient ( BASE_URL ) ;
185
- var request = new RestRequest ( RequestBodyCapturer . RESOURCE , httpMethod ) ;
183
+ RestClient client = new RestClient ( BASE_URL ) ;
184
+ RestRequest request = new RestRequest ( RequestBodyCapturer . RESOURCE , httpMethod ) ;
186
185
187
186
const string contentType = "text/plain" ;
188
187
const string bodyData = "abc123 foo bar baz BING!" ;
189
188
190
189
request . AddParameter ( contentType , bodyData , ParameterType . RequestBody ) ;
191
190
192
- var resetEvent = new ManualResetEvent ( false ) ;
191
+ ManualResetEvent resetEvent = new ManualResetEvent ( false ) ;
193
192
194
193
client . ExecuteAsync ( request , response => resetEvent . Set ( ) ) ;
195
194
resetEvent . WaitOne ( ) ;
@@ -224,7 +223,7 @@ private class RequestBodyCapturer
224
223
225
224
public static void Capture ( HttpListenerContext context )
226
225
{
227
- var request = context . Request ;
226
+ HttpListenerRequest request = context . Request ;
228
227
229
228
CapturedContentType = request . ContentType ;
230
229
CapturedHasEntityBody = request . HasEntityBody ;
@@ -233,7 +232,7 @@ public static void Capture(HttpListenerContext context)
233
232
234
233
private static string StreamToString ( Stream stream )
235
234
{
236
- var streamReader = new StreamReader ( stream ) ;
235
+ StreamReader streamReader = new StreamReader ( stream ) ;
237
236
return streamReader . ReadToEnd ( ) ;
238
237
}
239
238
}
0 commit comments