mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-05-29 17:32:44 +00:00
Use helper to get authd client
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user