removed tests using obsolete API

This commit is contained in:
Brendan Forster
2015-12-09 17:07:29 +10:30
parent f63690c4d3
commit 9c39a95044
@@ -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]