Add actual "GetAllForRepository" Activity Feed (#1288)

This commit is contained in:
Tim Miller
2016-05-04 21:57:31 -04:00
committed by Brendan Forster
parent 7bb751c594
commit 7b372253ca
8 changed files with 283 additions and 6 deletions
@@ -44,7 +44,7 @@ namespace Octokit.Tests.Reactive
client.GetAllForRepository("fake", "repo");
gitHubClient.Connection.Received(1).Get<List<Activity>>(new Uri("repos/fake/repo/issues/events", UriKind.Relative), Args.EmptyDictionary, null);
gitHubClient.Connection.Received(1).Get<List<Activity>>(new Uri("repos/fake/repo/events", UriKind.Relative), Args.EmptyDictionary, null);
}
[Fact]
@@ -60,6 +60,32 @@ namespace Octokit.Tests.Reactive
}
}
public class TheGetAllIssuesForRepositoryMethod
{
[Fact]
public void RequestsCorrectUrl()
{
var gitHubClient = Substitute.For<IGitHubClient>();
var client = new ObservableEventsClient(gitHubClient);
client.GetAllIssuesForRepository("fake", "repo");
gitHubClient.Connection.Received(1).Get<List<Activity>>(new Uri("repos/fake/repo/issues/events", UriKind.Relative), Args.EmptyDictionary, null);
}
[Fact]
public async Task EnsuresArgumentsNotNull()
{
var gitHubClient = Substitute.For<IGitHubClient>();
var client = new ObservableEventsClient(gitHubClient);
await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllIssuesForRepository(null, "name").ToTask());
await Assert.ThrowsAsync<ArgumentException>(() => client.GetAllIssuesForRepository("", "name").ToTask());
await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllIssuesForRepository("owner", null).ToTask());
await Assert.ThrowsAsync<ArgumentException>(() => client.GetAllIssuesForRepository("owner", "").ToTask());
}
}
public class TheGetAllForRepositoryNetworkMethod
{
[Fact]