mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-07 20:30:41 +00:00
the test, it passes
This commit is contained in:
@@ -3,7 +3,6 @@ using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Octokit;
|
||||
using Octokit.Tests.Helpers;
|
||||
using Octokit.Tests.Integration;
|
||||
using Xunit;
|
||||
|
||||
@@ -538,6 +537,20 @@ public class RepositoriesClientTests
|
||||
Assert.Equal("https://github.com/Haacked/libgit2sharp.git", repository.CloneUrl);
|
||||
Assert.True(repository.Fork);
|
||||
}
|
||||
|
||||
[IntegrationTest]
|
||||
public async Task ReturnsRedirectedRepository()
|
||||
{
|
||||
var github = Helper.GetAuthenticatedClient();
|
||||
|
||||
var repository = await github.Repository.Get("robconery", "massive");
|
||||
|
||||
Assert.Equal("https://github.com/FransBouma/Massive.git", repository.CloneUrl);
|
||||
Assert.False(repository.Private);
|
||||
Assert.False(repository.Fork);
|
||||
Assert.Equal(AccountType.User, repository.Owner.Type);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -439,7 +439,7 @@ namespace Octokit.Tests.Http
|
||||
httpClient.Received().Send(Arg.Is<IRequest>(req =>
|
||||
req.BaseAddress == _exampleUri &&
|
||||
req.Body == body &&
|
||||
req.Headers["Accept"] == "application/vnd.github.v3+json; charset=utf-8" &&
|
||||
req.Headers["Accept"] == "application/vnd.github.quicksilver-preview+json; charset=utf-8, application/vnd.github.v3+json; charset=utf-8" &&
|
||||
req.ContentType == "application/arbitrary" &&
|
||||
req.Method == HttpMethod.Post &&
|
||||
req.Endpoint == new Uri("https://other.host.com/path?query=val")), Args.CancellationToken);
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace Octokit.Tests.Http
|
||||
jsonPipeline.SerializeRequest(request);
|
||||
|
||||
Assert.Contains("Accept", request.Headers.Keys);
|
||||
Assert.Equal("application/vnd.github.v3+json; charset=utf-8", request.Headers["Accept"]);
|
||||
Assert.Equal("application/vnd.github.quicksilver-preview+json; charset=utf-8, application/vnd.github.v3+json; charset=utf-8", request.Headers["Accept"]);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Octokit.Internal
|
||||
/// </summary>
|
||||
public class JsonHttpPipeline
|
||||
{
|
||||
private const string v3ApiVersion = "application/vnd.github.v3+json; charset=utf-8";
|
||||
private const string v3ApiVersion = "application/vnd.github.quicksilver-preview+json; charset=utf-8, application/vnd.github.v3+json; charset=utf-8";
|
||||
|
||||
readonly IJsonSerializer _serializer;
|
||||
|
||||
@@ -32,7 +32,6 @@ namespace Octokit.Internal
|
||||
|
||||
if (!request.Headers.ContainsKey("Accept"))
|
||||
{
|
||||
|
||||
request.Headers["Accept"] = v3ApiVersion;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user