diff --git a/Octokit.Tests/Clients/RepositoryContentsClientTests.cs b/Octokit.Tests/Clients/RepositoryContentsClientTests.cs index 85707ee9f7..0e59b5334d 100644 --- a/Octokit.Tests/Clients/RepositoryContentsClientTests.cs +++ b/Octokit.Tests/Clients/RepositoryContentsClientTests.cs @@ -219,5 +219,22 @@ public async Task EnsuresNonNullArguments() await Assert.ThrowsAsync(() => client.UpdateFile("org", "repo", "path/to/file", null)); } } + + public class TheGetArchiveMethod + { + [Fact] + public void EnsurePassingCorrectParameters() + { + var connection = Substitute.For(); + 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(Arg.Is(uri => uri.ToString() == expectedUri), Arg.Is(span => span == expectedTimeSpan)); + } + } } } \ No newline at end of file diff --git a/Octokit/Clients/RepositoryContentsClient.cs b/Octokit/Clients/RepositoryContentsClient.cs index d7770db42b..7f3081c2ea 100644 --- a/Octokit/Clients/RepositoryContentsClient.cs +++ b/Octokit/Clients/RepositoryContentsClient.cs @@ -238,7 +238,7 @@ public Task GetArchiveLink(string owner, string name, ArchiveFormat arch /// The binary contents of the archive public Task 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)); } ///