use a different property to get the current username, instead of Credentials

This commit is contained in:
Brendan Forster
2013-11-28 14:23:34 -08:00
parent 73f301e8e7
commit 1a60206f35
4 changed files with 24 additions and 15 deletions
+9
View File
@@ -8,6 +8,13 @@ namespace Octokit.Tests.Integration
static readonly Lazy<Credentials> _credentialsThunk = new Lazy<Credentials>(() =>
{
var githubUsername = Environment.GetEnvironmentVariable("OCTOKIT_GITHUBUSERNAME");
UserName = githubUsername;
var githubToken = Environment.GetEnvironmentVariable("OCTOKIT_OAUTHTOKEN");
if (githubToken != null)
return new Credentials(githubToken);
var githubPassword = Environment.GetEnvironmentVariable("OCTOKIT_GITHUBPASSWORD");
if (githubUsername == null || githubPassword == null)
@@ -16,6 +23,8 @@ namespace Octokit.Tests.Integration
return new Credentials(githubUsername, githubPassword);
});
public static string UserName { get; private set; }
public static Credentials Credentials { get { return _credentialsThunk.Value; }}
public static void DeleteRepo(Repository repository)