diff --git a/Octokit.Tests/Clients/EventsClientTests.cs b/Octokit.Tests/Clients/EventsClientTests.cs index 57437d825f..caf0e89b17 100644 --- a/Octokit.Tests/Clients/EventsClientTests.cs +++ b/Octokit.Tests/Clients/EventsClientTests.cs @@ -28,6 +28,32 @@ public void RequestsCorrectUrl() } } + public class TheGetAllIssuesForRepositoryMethod + { + [Fact] + public void RequestsCorrectUrl() + { + var connection = Substitute.For(); + var client = new EventsClient(connection); + + client.GetAllIssuesForRepository("fake", "repo"); + + connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/issues/events")); + } + + [Fact] + public async Task EnsuresArgumentsNotNull() + { + var connection = Substitute.For(); + var client = new EventsClient(connection); + + await Assert.ThrowsAsync(() => client.GetAllIssuesForRepository(null, "name")); + await Assert.ThrowsAsync(() => client.GetAllIssuesForRepository("", "name")); + await Assert.ThrowsAsync(() => client.GetAllIssuesForRepository("owner", null)); + await Assert.ThrowsAsync(() => client.GetAllIssuesForRepository("owner", "")); + } + } + /* public class TheGetAllForRepositoryMethod { [Fact] @@ -38,7 +64,7 @@ public void RequestsCorrectUrl() client.GetAllForRepository("fake", "repo"); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/issues/events")); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/events")); } [Fact] @@ -53,7 +79,7 @@ public async Task EnsuresArgumentsNotNull() await Assert.ThrowsAsync(() => client.GetAllForRepository("owner", "")); } } - + */ public class TheGetAllForRepositoryNetworkMethod { [Fact] diff --git a/Octokit/Clients/EventsClient.cs b/Octokit/Clients/EventsClient.cs index 65e420f0f1..108a3ff5f6 100644 --- a/Octokit/Clients/EventsClient.cs +++ b/Octokit/Clients/EventsClient.cs @@ -41,7 +41,7 @@ public Task> GetAll() /// The owner of the repository /// The name of the repository /// All the s for the particular repository. - public Task> GetAllForRepository(string owner, string name) + public Task> GetAllIssuesForRepository(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); Ensure.ArgumentNotNullOrEmptyString(name, "name"); diff --git a/Octokit/Clients/IEventsClient.cs b/Octokit/Clients/IEventsClient.cs index ec14881501..88cf5c731f 100644 --- a/Octokit/Clients/IEventsClient.cs +++ b/Octokit/Clients/IEventsClient.cs @@ -30,7 +30,7 @@ public interface IEventsClient /// The owner of the repository /// The name of the repository /// All the s for the particular repository. - Task> GetAllForRepository(string owner, string name); + Task> GetAllIssuesForRepository(string owner, string name); /// /// Gets all the events for a given repository network