delete team with test

This commit is contained in:
Haroon
2013-11-07 10:21:56 +00:00
parent 53393054fc
commit 518fd7d8f5
3 changed files with 32 additions and 0 deletions
+13
View File
@@ -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"));
}
}
}
}
+8
View File
@@ -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);
}
}
+11
View File
@@ -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);
}
}
}