mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-04 19:26:51 +00:00
Merge pull request #766 from alfhenrik/followers-to-follow-conventions
Update Followers to follow GetAll* convention
This commit is contained in:
@@ -38,7 +38,7 @@ namespace Octokit.Reactive
|
||||
/// </remarks>
|
||||
/// <returns>A <see cref="IObservable{User}"/> of <see cref="User"/>s that the authenticated user follows.</returns>
|
||||
[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")]
|
||||
IObservable<User> GetFollowingForCurrent();
|
||||
IObservable<User> GetAllFollowingForCurrent();
|
||||
|
||||
/// <summary>
|
||||
/// List who a user is following
|
||||
@@ -48,7 +48,7 @@ namespace Octokit.Reactive
|
||||
/// See the <a href="http://developer.github.com/v3/users/followers/#list-users-followed-by-another-user">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <returns>A <see cref="IObservable{User}"/> of <see cref="User"/>s that the passed user follows.</returns>
|
||||
IObservable<User> GetFollowing(string login);
|
||||
IObservable<User> GetAllFollowing(string login);
|
||||
|
||||
/// <summary>
|
||||
/// Check if the authenticated user follows another user
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace Octokit.Reactive
|
||||
/// See the <a href="http://developer.github.com/v3/users/followers/#list-users-followed-by-another-user">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <returns>A <see cref="IObservable{User}"/> of <see cref="User"/>s that the authenticated user follows.</returns>
|
||||
public IObservable<User> GetFollowingForCurrent()
|
||||
public IObservable<User> GetAllFollowingForCurrent()
|
||||
{
|
||||
return _connection.GetAndFlattenAllPages<User>(ApiUrls.Following());
|
||||
}
|
||||
@@ -69,7 +69,7 @@ namespace Octokit.Reactive
|
||||
/// See the <a href="http://developer.github.com/v3/users/followers/#list-users-followed-by-another-user">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <returns>A <see cref="IObservable{User}"/> of <see cref="User"/>s that the passed user follows.</returns>
|
||||
public IObservable<User> GetFollowing(string login)
|
||||
public IObservable<User> GetAllFollowing(string login)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(login, "login");
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace Octokit.Tests.Clients
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
var client = new FollowersClient(connection);
|
||||
|
||||
client.GetFollowingForCurrent();
|
||||
client.GetAllFollowingForCurrent();
|
||||
|
||||
connection.Received().GetAll<User>(Arg.Is<Uri>(u => u.ToString() == "user/following"));
|
||||
}
|
||||
@@ -88,7 +88,7 @@ namespace Octokit.Tests.Clients
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
var client = new FollowersClient(connection);
|
||||
|
||||
client.GetFollowing("alfhenrik");
|
||||
client.GetAllFollowing("alfhenrik");
|
||||
|
||||
connection.Received().GetAll<User>(Arg.Is<Uri>(u => u.ToString() == "users/alfhenrik/following"));
|
||||
}
|
||||
@@ -99,8 +99,8 @@ namespace Octokit.Tests.Clients
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
var client = new FollowersClient(connection);
|
||||
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetFollowing(null));
|
||||
await Assert.ThrowsAsync<ArgumentException>(() => client.GetFollowing(""));
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllFollowing(null));
|
||||
await Assert.ThrowsAsync<ArgumentException>(() => client.GetAllFollowing(""));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace Octokit.Tests.Reactive
|
||||
var githubClient = Substitute.For<IGitHubClient>();
|
||||
var client = new ObservableFollowersClient(githubClient);
|
||||
|
||||
client.GetFollowingForCurrent();
|
||||
client.GetAllFollowingForCurrent();
|
||||
|
||||
githubClient.Connection.Received(1).Get<List<User>>(
|
||||
new Uri("user/following", UriKind.Relative), null, null);
|
||||
@@ -75,7 +75,7 @@ namespace Octokit.Tests.Reactive
|
||||
var githubClient = Substitute.For<IGitHubClient>();
|
||||
var client = new ObservableFollowersClient(githubClient);
|
||||
|
||||
client.GetFollowing("alfhenrik");
|
||||
client.GetAllFollowing("alfhenrik");
|
||||
|
||||
githubClient.Connection.Received(1).Get<List<User>>(
|
||||
new Uri("users/alfhenrik/following", UriKind.Relative), null, null);
|
||||
@@ -86,8 +86,8 @@ namespace Octokit.Tests.Reactive
|
||||
{
|
||||
var client = new ObservableFollowersClient(Substitute.For<IGitHubClient>());
|
||||
|
||||
await AssertEx.Throws<ArgumentNullException>(async () => await client.GetFollowing(null));
|
||||
await AssertEx.Throws<ArgumentException>(async () => await client.GetFollowing(""));
|
||||
await AssertEx.Throws<ArgumentNullException>(async () => await client.GetAllFollowing(null));
|
||||
await AssertEx.Throws<ArgumentException>(async () => await client.GetAllFollowing(""));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace Octokit
|
||||
/// See the <a href="http://developer.github.com/v3/users/followers/#list-users-followed-by-another-user">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <returns>A <see cref="IReadOnlyList{User}"/> of <see cref="User"/>s that the authenticated user follows.</returns>
|
||||
public Task<IReadOnlyList<User>> GetFollowingForCurrent()
|
||||
public Task<IReadOnlyList<User>> GetAllFollowingForCurrent()
|
||||
{
|
||||
return ApiConnection.GetAll<User>(ApiUrls.Following());
|
||||
}
|
||||
@@ -67,7 +67,7 @@ namespace Octokit
|
||||
/// See the <a href="http://developer.github.com/v3/users/followers/#list-users-followed-by-another-user">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <returns>A <see cref="IReadOnlyList{User}"/> of <see cref="User"/>s that the passed user follows.</returns>
|
||||
public Task<IReadOnlyList<User>> GetFollowing(string login)
|
||||
public Task<IReadOnlyList<User>> GetAllFollowing(string login)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(login, "login");
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace Octokit
|
||||
/// </remarks>
|
||||
/// <returns>A <see cref="IReadOnlyList{User}"/> of <see cref="User"/>s that the authenticated user follows.</returns>
|
||||
[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")]
|
||||
Task<IReadOnlyList<User>> GetFollowingForCurrent();
|
||||
Task<IReadOnlyList<User>> GetAllFollowingForCurrent();
|
||||
|
||||
/// <summary>
|
||||
/// List who a user is following
|
||||
@@ -50,7 +50,7 @@ namespace Octokit
|
||||
/// See the <a href="http://developer.github.com/v3/users/followers/#list-users-followed-by-another-user">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <returns>A <see cref="IReadOnlyList{User}"/> of <see cref="User"/>s that the passed user follows.</returns>
|
||||
Task<IReadOnlyList<User>> GetFollowing(string login);
|
||||
Task<IReadOnlyList<User>> GetAllFollowing(string login);
|
||||
|
||||
/// <summary>
|
||||
/// Check if the authenticated user follows another user
|
||||
|
||||
Reference in New Issue
Block a user