From 140bbc98362390fc782c65ae276be2ba9a767156 Mon Sep 17 00:00:00 2001 From: Henrik Andersson Date: Sat, 21 Mar 2015 23:55:42 +1000 Subject: [PATCH] Update Followers to follow GetAll* convention --- Octokit.Reactive/Clients/IObservableFollowersClient.cs | 4 ++-- Octokit.Reactive/Clients/ObservableFollowersClient.cs | 4 ++-- Octokit.Tests.Integration/Clients/FollowersClientTests.cs | 6 +++--- Octokit.Tests/Clients/FollowersClientTests.cs | 8 ++++---- Octokit.Tests/Reactive/ObservableFollowersTest.cs | 8 ++++---- Octokit/Clients/FollowersClient.cs | 4 ++-- Octokit/Clients/IFollowersClient.cs | 4 ++-- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Octokit.Reactive/Clients/IObservableFollowersClient.cs b/Octokit.Reactive/Clients/IObservableFollowersClient.cs index bae85c30..b867e970 100644 --- a/Octokit.Reactive/Clients/IObservableFollowersClient.cs +++ b/Octokit.Reactive/Clients/IObservableFollowersClient.cs @@ -38,7 +38,7 @@ namespace Octokit.Reactive /// /// A of s that the authenticated user follows. [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")] - IObservable GetFollowingForCurrent(); + IObservable GetAllFollowingForCurrent(); /// /// List who a user is following @@ -48,7 +48,7 @@ namespace Octokit.Reactive /// See the API documentation for more information. /// /// A of s that the passed user follows. - IObservable GetFollowing(string login); + IObservable GetAllFollowing(string login); /// /// Check if the authenticated user follows another user diff --git a/Octokit.Reactive/Clients/ObservableFollowersClient.cs b/Octokit.Reactive/Clients/ObservableFollowersClient.cs index 508a440e..c77b4571 100644 --- a/Octokit.Reactive/Clients/ObservableFollowersClient.cs +++ b/Octokit.Reactive/Clients/ObservableFollowersClient.cs @@ -56,7 +56,7 @@ namespace Octokit.Reactive /// See the API documentation for more information. /// /// A of s that the authenticated user follows. - public IObservable GetFollowingForCurrent() + public IObservable GetAllFollowingForCurrent() { return _connection.GetAndFlattenAllPages(ApiUrls.Following()); } @@ -69,7 +69,7 @@ namespace Octokit.Reactive /// See the API documentation for more information. /// /// A of s that the passed user follows. - public IObservable GetFollowing(string login) + public IObservable GetAllFollowing(string login) { Ensure.ArgumentNotNullOrEmptyString(login, "login"); diff --git a/Octokit.Tests.Integration/Clients/FollowersClientTests.cs b/Octokit.Tests.Integration/Clients/FollowersClientTests.cs index 951d432a..99d382be 100644 --- a/Octokit.Tests.Integration/Clients/FollowersClientTests.cs +++ b/Octokit.Tests.Integration/Clients/FollowersClientTests.cs @@ -21,7 +21,7 @@ public class FollowersClientTests : IDisposable { await _github.User.Followers.Follow("alfhenrik"); - var following = await _github.User.Followers.GetFollowingForCurrent(); + var following = await _github.User.Followers.GetAllFollowingForCurrent(); Assert.NotNull(following); Assert.True(following.Any(f => f.Login == "alfhenrik")); @@ -30,7 +30,7 @@ public class FollowersClientTests : IDisposable [IntegrationTest] public async Task ReturnsUsersTheUserIsFollowing() { - var following = await _github.User.Followers.GetFollowing("alfhenrik"); + var following = await _github.User.Followers.GetAllFollowing("alfhenrik"); Assert.NotNull(following); Assert.NotEmpty(following); @@ -69,7 +69,7 @@ public class FollowersClientTests : IDisposable public async Task FollowUserNotBeingFollowedByTheUser() { var result = await _github.User.Followers.Follow("alfhenrik"); - var following = await _github.User.Followers.GetFollowingForCurrent(); + var following = await _github.User.Followers.GetAllFollowingForCurrent(); Assert.True(result); Assert.NotEmpty(following); diff --git a/Octokit.Tests/Clients/FollowersClientTests.cs b/Octokit.Tests/Clients/FollowersClientTests.cs index c7031ffe..ef700f4b 100644 --- a/Octokit.Tests/Clients/FollowersClientTests.cs +++ b/Octokit.Tests/Clients/FollowersClientTests.cs @@ -74,7 +74,7 @@ namespace Octokit.Tests.Clients var connection = Substitute.For(); var client = new FollowersClient(connection); - client.GetFollowingForCurrent(); + client.GetAllFollowingForCurrent(); connection.Received().GetAll(Arg.Is(u => u.ToString() == "user/following")); } @@ -88,7 +88,7 @@ namespace Octokit.Tests.Clients var connection = Substitute.For(); var client = new FollowersClient(connection); - client.GetFollowing("alfhenrik"); + client.GetAllFollowing("alfhenrik"); connection.Received().GetAll(Arg.Is(u => u.ToString() == "users/alfhenrik/following")); } @@ -99,8 +99,8 @@ namespace Octokit.Tests.Clients var connection = Substitute.For(); var client = new FollowersClient(connection); - await Assert.ThrowsAsync(() => client.GetFollowing(null)); - await Assert.ThrowsAsync(() => client.GetFollowing("")); + await Assert.ThrowsAsync(() => client.GetAllFollowing(null)); + await Assert.ThrowsAsync(() => client.GetAllFollowing("")); } } diff --git a/Octokit.Tests/Reactive/ObservableFollowersTest.cs b/Octokit.Tests/Reactive/ObservableFollowersTest.cs index 30c8d689..fcaa1b28 100644 --- a/Octokit.Tests/Reactive/ObservableFollowersTest.cs +++ b/Octokit.Tests/Reactive/ObservableFollowersTest.cs @@ -60,7 +60,7 @@ namespace Octokit.Tests.Reactive var githubClient = Substitute.For(); var client = new ObservableFollowersClient(githubClient); - client.GetFollowingForCurrent(); + client.GetAllFollowingForCurrent(); githubClient.Connection.Received(1).Get>( new Uri("user/following", UriKind.Relative), null, null); @@ -75,7 +75,7 @@ namespace Octokit.Tests.Reactive var githubClient = Substitute.For(); var client = new ObservableFollowersClient(githubClient); - client.GetFollowing("alfhenrik"); + client.GetAllFollowing("alfhenrik"); githubClient.Connection.Received(1).Get>( new Uri("users/alfhenrik/following", UriKind.Relative), null, null); @@ -86,8 +86,8 @@ namespace Octokit.Tests.Reactive { var client = new ObservableFollowersClient(Substitute.For()); - await AssertEx.Throws(async () => await client.GetFollowing(null)); - await AssertEx.Throws(async () => await client.GetFollowing("")); + await AssertEx.Throws(async () => await client.GetAllFollowing(null)); + await AssertEx.Throws(async () => await client.GetAllFollowing("")); } } diff --git a/Octokit/Clients/FollowersClient.cs b/Octokit/Clients/FollowersClient.cs index 9059371c..9d85c4dc 100644 --- a/Octokit/Clients/FollowersClient.cs +++ b/Octokit/Clients/FollowersClient.cs @@ -54,7 +54,7 @@ namespace Octokit /// See the API documentation for more information. /// /// A of s that the authenticated user follows. - public Task> GetFollowingForCurrent() + public Task> GetAllFollowingForCurrent() { return ApiConnection.GetAll(ApiUrls.Following()); } @@ -67,7 +67,7 @@ namespace Octokit /// See the API documentation for more information. /// /// A of s that the passed user follows. - public Task> GetFollowing(string login) + public Task> GetAllFollowing(string login) { Ensure.ArgumentNotNullOrEmptyString(login, "login"); diff --git a/Octokit/Clients/IFollowersClient.cs b/Octokit/Clients/IFollowersClient.cs index b73dc583..00f7b7e0 100644 --- a/Octokit/Clients/IFollowersClient.cs +++ b/Octokit/Clients/IFollowersClient.cs @@ -40,7 +40,7 @@ namespace Octokit /// /// A of s that the authenticated user follows. [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")] - Task> GetFollowingForCurrent(); + Task> GetAllFollowingForCurrent(); /// /// List who a user is following @@ -50,7 +50,7 @@ namespace Octokit /// See the API documentation for more information. /// /// A of s that the passed user follows. - Task> GetFollowing(string login); + Task> GetAllFollowing(string login); /// /// Check if the authenticated user follows another user