Make IResponse.Headers a readonly dictionary

This commit is contained in:
Haacked
2015-01-01 22:12:02 -08:00
parent aace9902b9
commit c2d51570fd
4 changed files with 12 additions and 19 deletions
+4 -7
View File
@@ -111,9 +111,9 @@ namespace Octokit.Tests.Http
string headerKey,
string otpHeaderValue)
{
var headers = new Dictionary<string, string> { { headerKey, otpHeaderValue } };
var httpClient = Substitute.For<IHttpClient>();
IResponse response = new Response { StatusCode = HttpStatusCode.Unauthorized };
response.Headers[headerKey] = otpHeaderValue;
IResponse response = new Response(HttpStatusCode.Unauthorized, null, headers, "application/json");
httpClient.Send(Args.Request, Args.CancellationToken).Returns(Task.FromResult(response));
var connection = new Connection(new ProductHeaderValue("OctokitTests"),
_exampleUri,
@@ -138,12 +138,9 @@ namespace Octokit.Tests.Http
string otpHeaderValue,
TwoFactorType expectedFactorType)
{
var headers = new Dictionary<string, string> { { headerKey, otpHeaderValue } };
IResponse response = new Response(HttpStatusCode.Unauthorized, null, headers, "application/json");
var httpClient = Substitute.For<IHttpClient>();
IResponse response = new Response
{
StatusCode = HttpStatusCode.Unauthorized,
};
response.Headers[headerKey] = otpHeaderValue;
httpClient.Send(Args.Request, Args.CancellationToken).Returns(Task.FromResult(response));
var connection = new Connection(new ProductHeaderValue("OctokitTests"),
_exampleUri,