diff --git a/Octokit.Tests/Clients/TeamsClientTests.cs b/Octokit.Tests/Clients/TeamsClientTests.cs index bd5884a6..fa224636 100644 --- a/Octokit.Tests/Clients/TeamsClientTests.cs +++ b/Octokit.Tests/Clients/TeamsClientTests.cs @@ -95,5 +95,18 @@ namespace Octokit.Tests.Clients } } + public class TheDeleteTeamMethod + { + [Fact] + public void RequestsTheCorrectUrl() + { + var connection = Substitute.For(); + var client = new TeamsClient(connection); + client.DeleteTeam(1); + + connection.Received().Delete(Arg.Is(u => u.ToString() == "teams/1")); + } + } + } } diff --git a/Octokit/Clients/ITeamsClient.cs b/Octokit/Clients/ITeamsClient.cs index 07f6cda7..3737e484 100644 --- a/Octokit/Clients/ITeamsClient.cs +++ b/Octokit/Clients/ITeamsClient.cs @@ -34,5 +34,13 @@ namespace Octokit /// Thrown when a general API error occurs. /// Updated Task UpdateTeam(int id, UpdateTeam team); + + /// + /// Delte a team - must have owner permissions to this + /// + /// Thrown when a general API error occurs. + /// + Task DeleteTeam(int id); + } } diff --git a/Octokit/Clients/TeamsClient.cs b/Octokit/Clients/TeamsClient.cs index aea55915..3cd08ba9 100644 --- a/Octokit/Clients/TeamsClient.cs +++ b/Octokit/Clients/TeamsClient.cs @@ -66,5 +66,16 @@ namespace Octokit var endpoint = "teams/{0}".FormatUri(id); return ApiConnection.Patch(endpoint, team); } + + /// + /// Delte a team - must have owner permissions to this + /// + /// Thrown when a general API error occurs. + /// + public Task DeleteTeam(int id) + { + var endpoint = "teams/{0}".FormatUri(id); + return ApiConnection.Delete(endpoint); + } } }