mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-05 11:40:42 +00:00
removed tests using obsolete API
This commit is contained in:
@@ -56,60 +56,6 @@ namespace Octokit.Tests.Clients
|
||||
}
|
||||
}
|
||||
|
||||
public class TheGetArchiveLinkMethod
|
||||
{
|
||||
[Fact]
|
||||
public async Task ReturnsArchiveLinkWithDefaults()
|
||||
{
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
connection.GetRedirect(Args.Uri).Returns(Task.FromResult("https://codeload.github.com/fake/repo/legacy.tar.gz/master"));
|
||||
var contentsClient = new RepositoryContentsClient(connection);
|
||||
|
||||
var archiveLink = await contentsClient.GetArchiveLink("fake", "repo");
|
||||
|
||||
connection.Received().GetRedirect(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/tarball/"));
|
||||
Assert.Equal("https://codeload.github.com/fake/repo/legacy.tar.gz/master", archiveLink);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ReturnsArchiveLinkAsZipball()
|
||||
{
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
connection.GetRedirect(Args.Uri).Returns(Task.FromResult("https://codeload.github.com/fake/repo/legacy.tar.gz/master"));
|
||||
var contentsClient = new RepositoryContentsClient(connection);
|
||||
|
||||
var archiveLink = await contentsClient.GetArchiveLink("fake", "repo", ArchiveFormat.Zipball);
|
||||
|
||||
connection.Received().GetRedirect(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/zipball/"));
|
||||
Assert.Equal("https://codeload.github.com/fake/repo/legacy.tar.gz/master", archiveLink);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ReturnsArchiveLinkWithSpecifiedValues()
|
||||
{
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
connection.GetRedirect(Args.Uri).Returns(Task.FromResult("https://codeload.github.com/fake/repo/legazy.zip/release"));
|
||||
var contentsClient = new RepositoryContentsClient(connection);
|
||||
|
||||
var archiveLink = await contentsClient.GetArchiveLink("fake", "repo", ArchiveFormat.Zipball, "release");
|
||||
|
||||
connection.Received().GetRedirect(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/zipball/release"));
|
||||
Assert.Equal("https://codeload.github.com/fake/repo/legazy.zip/release", archiveLink);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task EnsuresArgumentsNotNull()
|
||||
{
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
var contentsClient = new RepositoryContentsClient(connection);
|
||||
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => contentsClient.GetArchiveLink(null, "name"));
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => contentsClient.GetArchiveLink("owner", null));
|
||||
await Assert.ThrowsAsync<ArgumentException>(() => contentsClient.GetArchiveLink("", "name"));
|
||||
await Assert.ThrowsAsync<ArgumentException>(() => contentsClient.GetArchiveLink("owner", ""));
|
||||
}
|
||||
}
|
||||
|
||||
public class TheGetContentsMethod
|
||||
{
|
||||
[Fact]
|
||||
|
||||
Reference in New Issue
Block a user