Make Response.Body readonly

This commit is contained in:
Haacked
2015-01-01 22:45:51 -08:00
parent d8f50292e3
commit 89e8fdfeaf
9 changed files with 92 additions and 80 deletions
@@ -1,4 +1,5 @@
using System.Net;
using System.Collections.Generic;
using System.Net;
using Octokit.Internal;
using Xunit;
@@ -13,7 +14,11 @@ namespace Octokit.Tests.Exceptions
{
const string responseBody = "{\"message\":\"YOU SHALL NOT PASS!\"," +
"\"documentation_url\":\"http://developer.github.com/v3\"}";
var response = new Response { Body = responseBody, StatusCode = HttpStatusCode.Forbidden };
var response = new Response(
HttpStatusCode.Forbidden,
responseBody,
new Dictionary<string, string>(),
"application/json");
var forbiddenException = new ForbiddenException(response);
Assert.Equal("YOU SHALL NOT PASS!", forbiddenException.ApiError.Message);