mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-03 03:01:31 +00:00
Merge pull request #1113 from michael-kokorin/bug-1102-wrong-reference
Fix passing wrong reference in GetArchive method of RepositoryContentsClient
This commit is contained in:
@@ -219,5 +219,22 @@ namespace Octokit.Tests.Clients
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => client.UpdateFile("org", "repo", "path/to/file", null));
|
||||
}
|
||||
}
|
||||
|
||||
public class TheGetArchiveMethod
|
||||
{
|
||||
[Fact]
|
||||
public void EnsurePassingCorrectParameters()
|
||||
{
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
var client = new RepositoryContentsClient(connection);
|
||||
|
||||
client.GetArchive("org", "repo", ArchiveFormat.Tarball, "dev");
|
||||
|
||||
const string expectedUri = "repos/org/repo/tarball/dev";
|
||||
var expectedTimeSpan = TimeSpan.FromMinutes(60);
|
||||
|
||||
connection.Connection.Received().Get<byte[]>(Arg.Is<Uri>(uri => uri.ToString() == expectedUri), Arg.Is<TimeSpan>(span => span == expectedTimeSpan));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -238,7 +238,7 @@ namespace Octokit
|
||||
/// <returns>The binary contents of the archive</returns>
|
||||
public Task<byte[]> GetArchive(string owner, string name, ArchiveFormat archiveFormat, string reference)
|
||||
{
|
||||
return GetArchive(owner, name, archiveFormat, string.Empty, TimeSpan.FromMinutes(60));
|
||||
return GetArchive(owner, name, archiveFormat, reference, TimeSpan.FromMinutes(60));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user