Skip to content
This repository was archived by the owner on Apr 10, 2018. It is now read-only.

Commit 0c85727

Browse files
committed
Refactoring and simplification
1 parent 5179ad2 commit 0c85727

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

RestSharp.Portable.Test/IssueTests.cs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
using System;
22
using System.Collections.Generic;
3-
using System.Diagnostics.CodeAnalysis;
43
using System.Net.Http;
54
using System.Threading.Tasks;
65

6+
using JetBrains.Annotations;
7+
78
using RestSharp.Portable.Authenticators;
89

910
using 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

Comments
 (0)