removed new, but obsolete code

This commit is contained in:
Brendan Forster
2015-05-22 14:29:11 +09:30
parent b9da729177
commit 4490968126
5 changed files with 11 additions and 83 deletions
@@ -63,19 +63,6 @@ namespace Octokit.Reactive
/// <returns></returns>
IObservable<Unit> Delete(int id);
/// <summary>
/// Adds a <see cref="User"/> to a <see cref="Team"/>.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/orgs/teams/#add-team-member">API documentation</a> for more information.
/// </remarks>
/// <param name="id">The team identifier.</param>
/// <param name="login">The user to add to the team.</param>
/// <exception cref="ApiValidationException">Thrown if you attempt to add an organization to a team.</exception>
/// <returns><see langword="true"/> if the user was added to the team; <see langword="false"/> otherwise.</returns>
[Obsolete("Use AddMembership(id, login) to track pending requests")]
IObservable<bool> AddMember(int id, string login);
/// <summary>
/// Adds a <see cref="User"/> to a <see cref="Team"/>.
/// </summary>
@@ -97,8 +84,7 @@ namespace Octokit.Reactive
/// <param name="id">The team identifier.</param>
/// <param name="login">The user to remove from the team.</param>
/// <returns><see langword="true"/> if the user was removed from the team; <see langword="false"/> otherwise.</returns>
IObservable<bool> RemoveMember(int id, string login);
IObservable<bool> RemoveMembership(int id, string login);
/// <summary>
/// Gets whether the user with the given <paramref name="login"/>
@@ -95,22 +95,6 @@ namespace Octokit.Reactive
return _client.Delete(id).ToObservable();
}
/// <summary>
/// Adds a <see cref="User"/> to a <see cref="Team"/>.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/orgs/teams/#add-team-member">API documentation</a> for more information.
/// </remarks>
/// <param name="id">The team identifier.</param>
/// <param name="login">The user to add to the team.</param>
/// <exception cref="ApiValidationException">Thrown if you attempt to add an organization to a team.</exception>
/// <returns><see langword="true"/> if the user was added to the team; <see langword="false"/> otherwise.</returns>
[Obsolete("Use AddMembership(int, login) to get pending invitations")]
public IObservable<bool> AddMember(int id, string login)
{
return _client.AddMember(id, login).ToObservable();
}
/// <summary>
/// Adds a <see cref="User"/> to a <see cref="Team"/>.
/// </summary>
@@ -135,9 +119,9 @@ namespace Octokit.Reactive
/// <param name="id">The team identifier.</param>
/// <param name="login">The user to remove from the team.</param>
/// <returns><see langword="true"/> if the user was removed from the team; <see langword="false"/> otherwise.</returns>
public IObservable<bool> RemoveMember(int id, string login)
public IObservable<bool> RemoveMembership(int id, string login)
{
return _client.RemoveMember(id, login).ToObservable();
return _client.RemoveMembership(id, login).ToObservable();
}
/// <summary>
+6 -6
View File
@@ -143,7 +143,7 @@ namespace Octokit.Tests.Clients
var connection = Substitute.For<IApiConnection>();
var client = new TeamsClient(connection);
client.AddMember(1, "user");
client.AddMembership(1, "user");
connection.Connection.Received().Put(Arg.Is<Uri>(u => u.ToString() == "teams/1/memberships/user"));
}
@@ -154,8 +154,8 @@ namespace Octokit.Tests.Clients
var connection = Substitute.For<IApiConnection>();
var client = new TeamsClient(connection);
await Assert.ThrowsAsync<ArgumentNullException>(() => client.AddMember(1, null));
await Assert.ThrowsAsync<ArgumentException>(() => client.AddMember(1, ""));
await Assert.ThrowsAsync<ArgumentNullException>(() => client.AddMembership(1, null));
await Assert.ThrowsAsync<ArgumentException>(() => client.AddMembership(1, ""));
}
}
@@ -187,7 +187,7 @@ namespace Octokit.Tests.Clients
{
var connection = Substitute.For<IApiConnection>();
var client = new TeamsClient(connection);
client.RemoveMember(1, "user");
client.RemoveMembership(1, "user");
connection.Connection.Received().Delete(Arg.Is<Uri>(u => u.ToString() == "teams/1/memberships/user"));
}
@@ -198,8 +198,8 @@ namespace Octokit.Tests.Clients
var connection = Substitute.For<IApiConnection>();
var client = new TeamsClient(connection);
await Assert.ThrowsAsync<ArgumentNullException>(() => client.RemoveMember(1, null));
await Assert.ThrowsAsync<ArgumentException>(() => client.RemoveMember(1, ""));
await Assert.ThrowsAsync<ArgumentNullException>(() => client.RemoveMembership(1, null));
await Assert.ThrowsAsync<ArgumentException>(() => client.RemoveMembership(1, ""));
}
}
+1 -14
View File
@@ -65,19 +65,6 @@ namespace Octokit
/// <returns></returns>
Task Delete(int id);
/// <summary>
/// Adds a <see cref="User"/> to a <see cref="Team"/>.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/orgs/teams/#add-team-member">API documentation</a> for more information.
/// </remarks>
/// <param name="id">The team identifier.</param>
/// <param name="login">The user to add to the team.</param>
/// <exception cref="ApiValidationException">Thrown if you attempt to add an organization to a team.</exception>
/// <returns><see langword="true"/> if the user was added to the team; <see langword="false"/> otherwise.</returns>
[Obsolete("Use AddMembership(id, login) to track pending requests")]
Task<bool> AddMember(int id, string login);
/// <summary>
/// Adds a <see cref="User"/> to a <see cref="Team"/>.
/// </summary>
@@ -99,7 +86,7 @@ namespace Octokit
/// <param name="id">The team identifier.</param>
/// <param name="login">The user to remove from the team.</param>
/// <returns><see langword="true"/> if the user was removed from the team; <see langword="false"/> otherwise.</returns>
Task<bool> RemoveMember(int id, string login);
Task<bool> RemoveMembership(int id, string login);
/// <summary>
/// Gets whether the user with the given <paramref name="login"/>
+1 -30
View File
@@ -133,35 +133,6 @@ namespace Octokit
return ApiConnection.Delete(endpoint);
}
/// <summary>
/// Adds a <see cref="User"/> to a <see cref="Team"/>.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/orgs/teams/#add-team-member">API documentation</a> for more information.
/// </remarks>
/// <param name="id">The team identifier.</param>
/// <param name="login">The user to add to the team.</param>
/// <exception cref="ApiValidationException">Thrown if you attempt to add an organization to a team.</exception>
/// <returns><see langword="true"/> if the user was added to the team; <see langword="false"/> otherwise.</returns>
[Obsolete("Use AddTeamMember(id, login) to track pending requests")]
public async Task<bool> AddMember(int id, string login)
{
Ensure.ArgumentNotNullOrEmptyString(login, "login");
var endpoint = ApiUrls.TeamMember(id, login);
try
{
var httpStatusCode = await ApiConnection.Connection.Put(endpoint);
return httpStatusCode == HttpStatusCode.NoContent;
}
catch (NotFoundException)
{
return false;
}
}
/// <summary>
/// Adds a <see cref="User"/> to a <see cref="Team"/>.
/// </summary>
@@ -203,7 +174,7 @@ namespace Octokit
/// <param name="id">The team identifier.</param>
/// <param name="login">The user to remove from the team.</param>
/// <returns><see langword="true"/> if the user was removed from the team; <see langword="false"/> otherwise.</returns>
public async Task<bool> RemoveMember(int id, string login)
public async Task<bool> RemoveMembership(int id, string login)
{
Ensure.ArgumentNotNullOrEmptyString(login, "login");