- Added Get method to the Octokit/Clients/ITeamsClient interface.

- Implemented the aforementioned Get method in the
Octokit/Clients/TeamsClient class.

- Added test in Octokit.Tests/Clients/TeamsClientTests for the
aforementioned Get method.
This commit is contained in:
Jason K.
2014-02-27 16:50:54 -05:00
parent b4fc16e684
commit 8d3aa5b41e
3 changed files with 42 additions and 0 deletions
+14
View File
@@ -21,6 +21,20 @@ namespace Octokit.Tests.Clients
}
}
public class TheGetMethod
{
[Fact]
public void RequestsTheCorrectlUrl()
{
var connection = Substitute.For<IApiConnection>();
var client = new TeamsClient(connection);
client.Get(1);
connection.Received().Get<Team>(Arg.Is<Uri>(u => u.ToString() == "teams/1"), null);
}
}
public class TheGetAllMethod
{
[Fact]
+13
View File
@@ -14,6 +14,19 @@ namespace Octokit
/// </remarks>
public interface ITeamsClient
{
/// <summary>
/// Gets a <see cref="Team"/>.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/orgs/teams/#get-team
/// </remarks>
/// <param name="id">The id of the <see cref="Team"/>.</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns>A <see cref="Team"/>.</returns>
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get",
Justification = "Method makes a network request")]
Task<Team> Get(int id);
/// <summary>
/// Returns all <see cref="Team" />s for the current org.
/// </summary>
+15
View File
@@ -24,6 +24,21 @@ namespace Octokit
{
}
/// <summary>
/// Gets a <see cref="Team"/>.
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/orgs/teams/#get-team
/// </remarks>
/// <param name="id">The id of the <see cref="Team"/>.</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
/// <returns>A <see cref="Team"/>.</returns>
public Task<Team> Get(int id)
{
var endpoint = ApiUrls.Team(id);
return ApiConnection.Get<Team>(endpoint);
}
/// <summary>
/// Returns all <see cref="Team" />s for the current org.
/// </summary>