11using System ;
22using System . Collections . Generic ;
3- using System . Diagnostics . CodeAnalysis ;
43using System . Net . Http ;
54using System . Threading . Tasks ;
65
6+ using JetBrains . Annotations ;
7+
78using RestSharp . Portable . Authenticators ;
89
910using Xunit ;
@@ -22,7 +23,7 @@ public async Task TestIssue12_Post1()
2223 var request = new RestRequest ( "post" , HttpMethod . Post ) ;
2324 request . AddParameter ( "param1" , tmp ) ;
2425
25- var response = await client . Execute < PostResponse > ( request ) ;
26+ var response = await client . Execute < RequestResponse > ( request ) ;
2627 Assert . NotNull ( response . Data ) ;
2728 Assert . NotNull ( response . Data . Form ) ;
2829 Assert . True ( response . Data . Form . ContainsKey ( "param1" ) ) ;
@@ -42,7 +43,7 @@ public async Task TestIssue12_Post2()
4243 request . AddParameter ( "param1" , tmp ) ;
4344 request . AddParameter ( "param2" , "param2" ) ;
4445
45- var response = await client . Execute < PostResponse > ( request ) ;
46+ var response = await client . Execute < RequestResponse > ( request ) ;
4647 Assert . NotNull ( response . Data ) ;
4748 Assert . NotNull ( response . Data . Form ) ;
4849 Assert . True ( response . Data . Form . ContainsKey ( "param1" ) ) ;
@@ -73,11 +74,11 @@ public void TestIssue19()
7374 {
7475 var req1 = new RestRequest ( "post" , HttpMethod . Post ) ;
7576 req1 . AddParameter ( "a" , "value-of-a" ) ;
76- var t1 = client . Execute < PostResponse > ( req1 ) ;
77+ var t1 = client . Execute < RequestResponse > ( req1 ) ;
7778
7879 var req2 = new RestRequest ( "post" , HttpMethod . Post ) ;
7980 req2 . AddParameter ( "ab" , "value-of-ab" ) ;
80- var t2 = client . Execute < PostResponse > ( req2 ) ;
81+ var t2 = client . Execute < RequestResponse > ( req2 ) ;
8182
8283 Task . WaitAll ( t1 , t2 ) ;
8384
@@ -116,8 +117,8 @@ public void TestIssue25()
116117 var req2 = new RestRequest ( "post" , HttpMethod . Post ) ;
117118 req2 . AddParameter ( "ab" , "value-of-ab" ) ;
118119
119- var t1 = client . Execute < PostResponse > ( req1 ) ;
120- var t2 = client . Execute < PostResponse > ( req2 ) ;
120+ var t1 = client . Execute < RequestResponse > ( req1 ) ;
121+ var t2 = client . Execute < RequestResponse > ( req2 ) ;
121122
122123 Task . WaitAll ( t1 , t2 ) ;
123124
@@ -133,11 +134,11 @@ public void TestIssue25()
133134 }
134135 }
135136
136- // ReSharper disable once ClassNeverInstantiated.Local
137- [ SuppressMessage ( "ReSharper" , "UnusedAutoPropertyAccessor.Local" , Justification = "ReSharper bug" ) ]
138- private class PostResponse
137+ [ UsedImplicitly ( ImplicitUseTargetFlags . WithMembers ) ]
138+ private class RequestResponse
139139 {
140140 public Dictionary < string , string > Form { get ; set ; }
141+ public Dictionary < string , string > Cookies { get ; set ; }
141142 }
142143 }
143144}
0 commit comments