Skip to content

Commit

Permalink
Rename EnterpriseHelper properties to remove "GHE" prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
ryangribble committed Feb 2, 2016
1 parent af169d6 commit bb4086b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public async Task CanCreateOrganization()
string orgLogin = Helper.MakeNameWithTimestamp("MyOrganization");
string orgName = String.Concat(orgLogin, " Display Name");

var newOrganization = new NewOrganization(orgLogin, EnterpriseHelper.GHEUserName, orgName);
var newOrganization = new NewOrganization(orgLogin, EnterpriseHelper.UserName, orgName);
var organization = await
_github.Enterprise.Organization.Create(newOrganization);

Expand Down
26 changes: 13 additions & 13 deletions Octokit.Tests.Integration/EnterpriseHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ public static class EnterpriseHelper
static readonly Lazy<Credentials> _credentialsThunk = new Lazy<Credentials>(() =>
{
var githubUsername = Environment.GetEnvironmentVariable("OCTOKIT_GHE_USERNAME");
GHEUserName = githubUsername;
GHEOrganization = Environment.GetEnvironmentVariable("OCTOKIT_GHE_ORGANIZATION");
UserName = githubUsername;
Organization = Environment.GetEnvironmentVariable("OCTOKIT_GHE_ORGANIZATION");

var githubToken = Environment.GetEnvironmentVariable("OCTOKIT_GHE_OAUTHTOKEN");

Expand Down Expand Up @@ -39,8 +39,8 @@ public static class EnterpriseHelper
static readonly Lazy<Credentials> _basicAuthCredentials = new Lazy<Credentials>(() =>
{
var githubUsername = Environment.GetEnvironmentVariable("OCTOKIT_GHE_USERNAME");
GHEUserName = githubUsername;
GHEOrganization = Environment.GetEnvironmentVariable("OCTOKIT_GHE_ORGANIZATION");
UserName = githubUsername;
Organization = Environment.GetEnvironmentVariable("OCTOKIT_GHE_ORGANIZATION");

var githubPassword = Environment.GetEnvironmentVariable("OCTOKIT_GHE_PASSWORD");

Expand Down Expand Up @@ -71,20 +71,20 @@ static EnterpriseHelper()
// Force reading of environment variables.
// This wasn't happening if UserName/Organization were
// retrieved before Credentials.
Debug.WriteIf(GHECredentials == null, "No credentials specified.");
Debug.WriteIf(Credentials == null, "No credentials specified.");
}

public static string GHEUserName { get; private set; }
public static string GHEOrganization { get; private set; }
public static string UserName { get; private set; }
public static string Organization { get; private set; }

/// <summary>
/// These credentials should be set to a test GitHub account using the powershell script configure-integration-tests.ps1
/// </summary>
public static Credentials GHECredentials { get { return _credentialsThunk.Value; } }
public static Credentials Credentials { get { return _credentialsThunk.Value; } }

public static Credentials GHEApplicationCredentials { get { return _oauthApplicationCredentials.Value; } }
public static Credentials ApplicationCredentials { get { return _oauthApplicationCredentials.Value; } }

public static Credentials GHEBasicAuthCredentials { get { return _basicAuthCredentials.Value; } }
public static Credentials BasicAuthCredentials { get { return _basicAuthCredentials.Value; } }

public static bool IsGitHubEnterpriseEnabled { get { return _gitHubEnterpriseEnabled.Value; } }

Expand Down Expand Up @@ -128,23 +128,23 @@ public static IGitHubClient GetAuthenticatedClient()
{
return new GitHubClient(new ProductHeaderValue("OctokitEnterpriseTests"), GitHubEnterpriseUrl)
{
Credentials = GHECredentials
Credentials = Credentials
};
}

public static IGitHubClient GetBasicAuthClient()
{
return new GitHubClient(new ProductHeaderValue("OctokitEnterpriseTests"), GitHubEnterpriseUrl)
{
Credentials = GHEBasicAuthCredentials
Credentials = BasicAuthCredentials
};
}

public static GitHubClient GetAuthenticatedApplicationClient()
{
return new GitHubClient(new ProductHeaderValue("OctokitEnterpriseTests"), GitHubEnterpriseUrl)
{
Credentials = GHEApplicationCredentials
Credentials = ApplicationCredentials
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public async Task CanCreateOrganization()
string orgLogin = Helper.MakeNameWithTimestamp("MyOrganization");
string orgName = String.Concat(orgLogin, " Display Name");

var newOrganization = new NewOrganization(orgLogin, EnterpriseHelper.GHEUserName, orgName);
var newOrganization = new NewOrganization(orgLogin, EnterpriseHelper.UserName, orgName);
var observable = _github.Enterprise.Organization.Create(newOrganization);
var organization = await observable;

Expand Down

0 comments on commit bb4086b

Please sign in to comment.