Use helper to get authd client

This commit is contained in:
Henrik Andersson
2015-05-08 19:13:36 +10:00
parent 0ac98e4135
commit 021e482d74
@@ -12,10 +12,7 @@ namespace Octokit.Tests.Integration.Clients
[IntegrationTest]
public async Task ReturnsReadmeForSeeGit()
{
var github = new GitHubClient(new ProductHeaderValue("OctokitTests"))
{
Credentials = Helper.Credentials
};
var github = Helper.GetAuthenticatedClient();
var readme = await github.Repository.Content.GetReadme("octokit", "octokit.net");
Assert.Equal("README.md", readme.Name);
@@ -28,10 +25,7 @@ namespace Octokit.Tests.Integration.Clients
[IntegrationTest]
public async Task ReturnsReadmeHtmlForSeeGit()
{
var github = new GitHubClient(new ProductHeaderValue("OctokitTests"))
{
Credentials = Helper.Credentials
};
var github = Helper.GetAuthenticatedClient();
var readmeHtml = await github.Repository.Content.GetReadmeHtml("octokit", "octokit.net");
Assert.True(readmeHtml.StartsWith("<div class="));
@@ -45,10 +39,7 @@ namespace Octokit.Tests.Integration.Clients
[IntegrationTest]
public async Task GetsFileContent()
{
var github = new GitHubClient(new ProductHeaderValue("OctokitTests"))
{
Credentials = Helper.Credentials
};
var github = Helper.GetAuthenticatedClient();
var contents = await github
.Repository
@@ -63,10 +54,7 @@ namespace Octokit.Tests.Integration.Clients
[IntegrationTest]
public async Task GetsDirectoryContent()
{
var github = new GitHubClient(new ProductHeaderValue("OctokitTests"))
{
Credentials = Helper.Credentials
};
var github = Helper.GetAuthenticatedClient();
var contents = await github
.Repository
@@ -81,10 +69,8 @@ namespace Octokit.Tests.Integration.Clients
[IntegrationTest]
public async Task CrudTest()
{
var client = new GitHubClient(new ProductHeaderValue("OctokitTests"))
{
Credentials = Helper.Credentials
};
var client = Helper.GetAuthenticatedClient();
Repository repository = null;
try
{
@@ -132,10 +118,7 @@ namespace Octokit.Tests.Integration.Clients
[IntegrationTest]
public async Task GetsArchiveLinkAsTarball()
{
var github = new GitHubClient(new ProductHeaderValue("OctokitTests"))
{
Credentials = Helper.Credentials
};
var github = Helper.GetAuthenticatedClient();
var archiveLink = await github
.Repository
@@ -148,10 +131,7 @@ namespace Octokit.Tests.Integration.Clients
[IntegrationTest]
public async Task GetsArchiveLinkAsZipball()
{
var github = new GitHubClient(new ProductHeaderValue("OctokitTests"))
{
Credentials = Helper.Credentials
};
var github = Helper.GetAuthenticatedClient();
var archiveLink = await github
.Repository
@@ -164,10 +144,7 @@ namespace Octokit.Tests.Integration.Clients
[IntegrationTest]
public async Task GetsArchiveLinkForReleaseBranchAsTarball()
{
var github = new GitHubClient(new ProductHeaderValue("OctokitTests"))
{
Credentials = Helper.Credentials
};
var github = Helper.GetAuthenticatedClient();
var archiveLink = await github
.Repository