mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-05 19:46:07 +00:00
- 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:
@@ -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]
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user