mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-06 03:55:55 +00:00
delete team with test
This commit is contained in:
@@ -95,5 +95,18 @@ namespace Octokit.Tests.Clients
|
||||
}
|
||||
}
|
||||
|
||||
public class TheDeleteTeamMethod
|
||||
{
|
||||
[Fact]
|
||||
public void RequestsTheCorrectUrl()
|
||||
{
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
var client = new TeamsClient(connection);
|
||||
client.DeleteTeam(1);
|
||||
|
||||
connection.Received().Delete(Arg.Is<Uri>(u => u.ToString() == "teams/1"));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,5 +34,13 @@ namespace Octokit
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>Updated <see cref="Team"/></returns>
|
||||
Task<Team> UpdateTeam(int id, UpdateTeam team);
|
||||
|
||||
/// <summary>
|
||||
/// Delte a team - must have owner permissions to this
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns></returns>
|
||||
Task DeleteTeam(int id);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,5 +66,16 @@ namespace Octokit
|
||||
var endpoint = "teams/{0}".FormatUri(id);
|
||||
return ApiConnection.Patch<Team>(endpoint, team);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delte a team - must have owner permissions to this
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns></returns>
|
||||
public Task DeleteTeam(int id)
|
||||
{
|
||||
var endpoint = "teams/{0}".FormatUri(id);
|
||||
return ApiConnection.Delete(endpoint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user