mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-07 04:16:51 +00:00
Make Response.Body readonly
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user