Implement Nested Teams preview API changes (#1682)

* Add new AcceptsHeader
add Parent field to Team
add ParentId field to NewTeam and UpdateTeam
update Create Edit and Delete Team methods to use preview header

* Implement new API call GetAllChildTeams()

* Implement GetAllChildTeams for ObservableClient

* add integration test for observable client

* Add pagination tests for GetAllChildTeams

* Add NestedTeams preview header to all the API calls that use it

* Update tests for accepts header

* Add accepts header to observable client calls

* Fix DELETE implementation to use correct overload

* Fix tests - parent and child teams must be visibility Closed whereas the default if not specified is Private

* make sure all tests are flagged as [OrganizationTest]

* Make sure Update tests change the parent of the team

* Update new methods with NesterTeams preview API header and adjust tests
This commit is contained in:
Ryan Gribble
2017-10-04 16:21:42 +10:00
committed by GitHub
parent da0c7a5785
commit e93646c9f1
15 changed files with 487 additions and 33 deletions
@@ -30,6 +30,7 @@ namespace Octokit.Tests.Integration.Helpers
internal static async Task<TeamContext> CreateTeamContext(this IObservableGitHubClient client, string organization, NewTeam newTeam)
{
newTeam.Privacy = TeamPrivacy.Closed;
var team = await client.Organization.Team.Create(organization, newTeam);
return new TeamContext(client.Connection, team);