diff --git a/Octokit.Tests/Clients/TeamsClientTests.cs b/Octokit.Tests/Clients/TeamsClientTests.cs index e3c09858..3251e7d0 100644 --- a/Octokit.Tests/Clients/TeamsClientTests.cs +++ b/Octokit.Tests/Clients/TeamsClientTests.cs @@ -21,6 +21,20 @@ namespace Octokit.Tests.Clients } } + public class TheGetMethod + { + [Fact] + public void RequestsTheCorrectlUrl() + { + var connection = Substitute.For(); + var client = new TeamsClient(connection); + + client.Get(1); + + connection.Received().Get(Arg.Is(u => u.ToString() == "teams/1"), null); + } + } + public class TheGetAllMethod { [Fact] diff --git a/Octokit/Clients/ITeamsClient.cs b/Octokit/Clients/ITeamsClient.cs index a2abafab..c00b5735 100644 --- a/Octokit/Clients/ITeamsClient.cs +++ b/Octokit/Clients/ITeamsClient.cs @@ -14,6 +14,19 @@ namespace Octokit /// public interface ITeamsClient { + /// + /// Gets a . + /// + /// + /// http://developer.github.com/v3/orgs/teams/#get-team + /// + /// The id of the . + /// Thrown when a general API error occurs. + /// A . + [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", + Justification = "Method makes a network request")] + Task Get(int id); + /// /// Returns all s for the current org. /// diff --git a/Octokit/Clients/TeamsClient.cs b/Octokit/Clients/TeamsClient.cs index 9928e62e..8d02e3df 100644 --- a/Octokit/Clients/TeamsClient.cs +++ b/Octokit/Clients/TeamsClient.cs @@ -24,6 +24,21 @@ namespace Octokit { } + /// + /// Gets a . + /// + /// + /// http://developer.github.com/v3/orgs/teams/#get-team + /// + /// The id of the . + /// Thrown when a general API error occurs. + /// A . + public Task Get(int id) + { + var endpoint = ApiUrls.Team(id); + return ApiConnection.Get(endpoint); + } + /// /// Returns all s for the current org. ///