Skip to content

Commit

Permalink
rename enterprise team context methods
Browse files Browse the repository at this point in the history
  • Loading branch information
martinscholz83 committed Jun 8, 2016
1 parent 71f992a commit 6e03a81
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public EnterpriseLdapClientTests()
_github = EnterpriseHelper.GetAuthenticatedClient();

NewTeam newTeam = new NewTeam(Helper.MakeNameWithTimestamp("test-team")) { Description = "Test Team" };
_context = _github.CreateEnterpriseTeamContext(EnterpriseHelper.Organization, newTeam).Result;
_context = _github.CreateTeamContext(EnterpriseHelper.Organization, newTeam).Result;
}

[GitHubEnterpriseTest]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public async Task CanRename()
{
string renamedUsername = Helper.MakeNameWithTimestamp("user-renamed");
// Create a disposable user for the test
using (var context = _github.CreateEnterpriseUserContext(GenerateNewUserDetails()).Result)
using (var context = _github.CreateUserContext(GenerateNewUserDetails()).Result)
{
var response = await _github.User.Administration.Rename(
context.UserLogin,
Expand All @@ -86,7 +86,7 @@ public async Task CanRename()
public async Task CanAddAndDeleteImpersonationToken()
{
// Create a disposable user for the test
using (var context = _github.CreateEnterpriseUserContext(GenerateNewUserDetails()).Result)
using (var context = _github.CreateUserContext(GenerateNewUserDetails()).Result)
{
// Create Impersonation token
var token = await _github.User.Administration.CreateImpersonationToken(
Expand All @@ -109,7 +109,7 @@ public async Task CanPromoteAndDemote()
User checkUser = null;

// Create a disposable user for the test
using (var context = _github.CreateEnterpriseUserContext(GenerateNewUserDetails()).Result)
using (var context = _github.CreateUserContext(GenerateNewUserDetails()).Result)
{
// Ensure user is not site admin
checkUser = await _github.User.Get(context.UserLogin);
Expand Down Expand Up @@ -137,7 +137,7 @@ public async Task CanSuspendAndUnsuspend()
User checkUser = null;

// Create a disposable user for the test
using (var context = _github.CreateEnterpriseUserContext(GenerateNewUserDetails()).Result)
using (var context = _github.CreateUserContext(GenerateNewUserDetails()).Result)
{
// Ensure user is not suspended
checkUser = await _github.User.Get(context.UserLogin);
Expand All @@ -163,7 +163,7 @@ public async Task CanSuspendAndUnsuspend()
public async Task CanListAllPublicKeys()
{
// Create a disposable user for the test
using (var context = _github.CreateEnterpriseUserContext(GenerateNewUserDetails()).Result)
using (var context = _github.CreateUserContext(GenerateNewUserDetails()).Result)
{
// Ensure user has a key
//var key = await _github.User.Keys.Create(new NewPublicKey("title", "key"));
Expand All @@ -183,7 +183,7 @@ public async Task CanListAllPublicKeys()
public async Task CanDeletePublicKey()
{
// Create a disposable user for the test
using (var context = _github.CreateEnterpriseUserContext(GenerateNewUserDetails()).Result)
using (var context = _github.CreateUserContext(GenerateNewUserDetails()).Result)
{
// Ensure user has a key
//var key = await _github.User.Keys.Create(new NewPublicKey("title", "key"));
Expand Down
4 changes: 2 additions & 2 deletions Octokit.Tests.Integration/Helpers/GithubClientExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ internal static async Task<RepositoryContext> CreateRepositoryContext(this IGitH
return new RepositoryContext(repo);
}

internal static async Task<TeamContext> CreateEnterpriseTeamContext(this IGitHubClient client, string organization, NewTeam newTeam)
internal static async Task<TeamContext> CreateTeamContext(this IGitHubClient client, string organization, NewTeam newTeam)
{
var team = await client.Organization.Team.Create(organization, newTeam);

return new TeamContext(team);
}

internal static async Task<EnterpriseUserContext> CreateEnterpriseUserContext(this IGitHubClient client, NewUser newUser)
internal static async Task<EnterpriseUserContext> CreateUserContext(this IGitHubClient client, NewUser newUser)
{
var user = await client.User.Administration.Create(newUser);

Expand Down

0 comments on commit 6e03a81

Please sign in to comment.