@@ -39,8 +39,12 @@ public void MultipartFormData_WithParameterAndFile_Async()
3939 using ( SimpleServer . Create ( baseUrl , EchoHandler ) )
4040 {
4141 RestClient client = new RestClient ( baseUrl ) ;
42- RestRequest request = new RestRequest ( "/" , Method . POST ) { AlwaysMultipartFormData = true } ;
43- DirectoryInfo directoryInfo = Directory . GetParent ( Directory . GetCurrentDirectory ( ) ) . Parent ;
42+ RestRequest request = new RestRequest ( "/" , Method . POST )
43+ {
44+ AlwaysMultipartFormData = true
45+ } ;
46+ DirectoryInfo directoryInfo = Directory . GetParent ( Directory . GetCurrentDirectory ( ) )
47+ . Parent ;
4448
4549 if ( directoryInfo != null )
4650 {
@@ -53,10 +57,10 @@ public void MultipartFormData_WithParameterAndFile_Async()
5357 request . AddParameter ( "controlName" , "test" , "application/json" , ParameterType . RequestBody ) ;
5458
5559 Task task = client . ExecuteTaskAsync ( request )
56- . ContinueWith ( x =>
57- {
58- Assert . AreEqual ( this . expectedFileAndBodyRequestContent , x . Result . Content ) ;
59- } ) ;
60+ . ContinueWith ( x =>
61+ {
62+ Assert . AreEqual ( this . expectedFileAndBodyRequestContent , x . Result . Content ) ;
63+ } ) ;
6064
6165 task . Wait ( ) ;
6266 }
@@ -70,13 +74,16 @@ public void MultipartFormData_WithParameterAndFile()
7074 using ( SimpleServer . Create ( baseUrl , EchoHandler ) )
7175 {
7276 RestClient client = new RestClient ( baseUrl ) ;
73- RestRequest request = new RestRequest ( "/" , Method . POST ) { AlwaysMultipartFormData = true } ;
74- DirectoryInfo directoryInfo = Directory . GetParent ( Directory . GetCurrentDirectory ( ) ) . Parent ;
77+ RestRequest request = new RestRequest ( "/" , Method . POST )
78+ {
79+ AlwaysMultipartFormData = true
80+ } ;
81+ DirectoryInfo directoryInfo = Directory . GetParent ( Directory . GetCurrentDirectory ( ) )
82+ . Parent ;
7583
7684 if ( directoryInfo != null )
7785 {
78- string path = Path . Combine ( directoryInfo . FullName ,
79- "Assets\\ TestFile.txt" ) ;
86+ string path = Path . Combine ( directoryInfo . FullName , "Assets\\ TestFile.txt" ) ;
8087
8188 request . AddFile ( "fileName" , path ) ;
8289 }
@@ -96,7 +103,10 @@ public void MultipartFormDataAsync()
96103 using ( SimpleServer . Create ( baseUrl , EchoHandler ) )
97104 {
98105 RestClient client = new RestClient ( baseUrl ) ;
99- RestRequest request = new RestRequest ( "/" , Method . POST ) { AlwaysMultipartFormData = true } ;
106+ RestRequest request = new RestRequest ( "/" , Method . POST )
107+ {
108+ AlwaysMultipartFormData = true
109+ } ;
100110
101111 AddParameters ( request ) ;
102112
@@ -116,7 +126,10 @@ public void MultipartFormData()
116126 using ( SimpleServer . Create ( baseUrl , EchoHandler ) )
117127 {
118128 RestClient client = new RestClient ( baseUrl ) ;
119- RestRequest request = new RestRequest ( "/" , Method . POST ) { AlwaysMultipartFormData = true } ;
129+ RestRequest request = new RestRequest ( "/" , Method . POST )
130+ {
131+ AlwaysMultipartFormData = true
132+ } ;
120133
121134 AddParameters ( request ) ;
122135
@@ -135,10 +148,10 @@ public void AlwaysMultipartFormData_WithParameter_Execute()
135148 {
136149 RestClient client = new RestClient ( baseUrl ) ;
137150 RestRequest request = new RestRequest ( "?json_route=/posts" )
138- {
139- AlwaysMultipartFormData = true ,
140- Method = Method . POST ,
141- } ;
151+ {
152+ AlwaysMultipartFormData = true ,
153+ Method = Method . POST ,
154+ } ;
142155
143156 request . AddParameter ( "title" , "test" , ParameterType . RequestBody ) ;
144157
@@ -164,7 +177,8 @@ public void AlwaysMultipartFormData_WithParameter_ExecuteTaskAsync()
164177
165178 request . AddParameter ( "title" , "test" , ParameterType . RequestBody ) ;
166179
167- Task task = client . ExecuteTaskAsync ( request ) . ContinueWith ( x => { Assert . Null ( x . Result . ErrorException ) ; } ) ;
180+ Task task = client . ExecuteTaskAsync ( request )
181+ . ContinueWith ( x => { Assert . Null ( x . Result . ErrorException ) ; } ) ;
168182
169183 task . Wait ( ) ;
170184 }
@@ -218,4 +232,4 @@ private static void AddParameters(IRestRequest request)
218232 request . AddParameter ( "a name with spaces" , "somedata" ) ;
219233 }
220234 }
221- }
235+ }
0 commit comments