mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-23 15:45:28 +00:00
* Add HTTP 451: Legal Takedown Exception. * Add LegalRestrictionException in HandleErrors. * Cast 451 to HttpStatusCode and include exception in csproj files. * Tests added and "FixProjects". * Fix: 403 -> 451 in 451Tests.
19 lines
580 B
C#
19 lines
580 B
C#
using System.Collections.Generic;
|
|
using System.Net;
|
|
using Octokit.Internal;
|
|
using Xunit;
|
|
|
|
namespace Octokit.Tests.Exceptions
|
|
{
|
|
public class LegalRestrictionExceptionTests
|
|
{
|
|
[Fact]
|
|
public void HasDefaultMessage()
|
|
{
|
|
var response = new Response((HttpStatusCode)451, null, new Dictionary<string, string>(), "application/json");
|
|
var legalRestrictionException = new LegalRestrictionException(response);
|
|
|
|
Assert.Equal("Resource taken down due to a DMCA notice.", legalRestrictionException.Message);
|
|
}
|
|
}
|
|
} |