Files
octokit.net/Octokit.Tests/Exceptions/LegalRestrictionExceptionTests.cs
Devesh Khandelwal cdd46465db Add custom exception for the HTTP 451 response (#1239)
* 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.
2016-04-10 14:07:18 -04:00

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);
}
}
}