mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-06 07:16:09 +00:00
Co-authored-by: Lehonti Ramos <john@doe> Co-authored-by: Keegan Campbell <me@kfcampbell.com>
52 lines
1.7 KiB
C#
52 lines
1.7 KiB
C#
using System.Threading.Tasks;
|
|
using Octokit.Tests.Integration;
|
|
using Xunit;
|
|
|
|
namespace Octokit.Tests.Clients
|
|
{
|
|
public class GitHubAppInstallationsClientTests
|
|
{
|
|
public class TheGetAllRepositoriesForCurrentMethod
|
|
{
|
|
readonly IGitHubClient _github;
|
|
|
|
public TheGetAllRepositoriesForCurrentMethod()
|
|
{
|
|
// Authenticate as a GitHubApp Installation
|
|
_github = Helper.GetAuthenticatedGitHubAppInstallationForOwner(Helper.UserName);
|
|
}
|
|
|
|
[GitHubAppsTest]
|
|
public async Task GetsAllRepositories()
|
|
{
|
|
var result = await _github.GitHubApps.Installation.GetAllRepositoriesForCurrent();
|
|
|
|
Assert.NotNull(result);
|
|
Assert.True(result.TotalCount > 0);
|
|
}
|
|
}
|
|
|
|
public class TheGetAllRepositoriesForCurrentUserMethod
|
|
{
|
|
readonly IGitHubClient _github;
|
|
|
|
public TheGetAllRepositoriesForCurrentUserMethod()
|
|
{
|
|
// Need to Authenticate as User to Server but not possible without receiving redirect from github.com
|
|
//_github = Helper.GetAuthenticatedUserToServer();
|
|
_github = null;
|
|
}
|
|
|
|
[GitHubAppsTest(Skip = "Not possible to authenticate with User to Server auth")]
|
|
public async Task GetsAllRepositories()
|
|
{
|
|
var installationId = Helper.GetGitHubAppInstallationForOwner(Helper.UserName).Id;
|
|
|
|
var result = await _github.GitHubApps.Installation.GetAllRepositoriesForCurrentUser(installationId);
|
|
|
|
Assert.NotNull(result);
|
|
Assert.True(result.TotalCount > 0);
|
|
}
|
|
}
|
|
}
|
|
} |