Files
octokit.net/Octokit.Tests.Integration/Reactive/ObservableGitHubAppInstallationsClientTests.cs
Lehonti Ramos d46527d143 Added readonly to fields that are never modified (#2759)
Co-authored-by: Lehonti Ramos <john@doe>
Co-authored-by: Keegan Campbell <me@kfcampbell.com>
2023-08-11 09:53:51 -07:00

54 lines
1.9 KiB
C#

using System.Reactive.Linq;
using System.Threading.Tasks;
using Octokit.Reactive;
using Octokit.Tests.Integration;
using Xunit;
namespace Octokit.Tests.Clients
{
public class ObservableGitHubAppInstallationsClientTests
{
public class TheGetAllRepositoriesForCurrentMethod
{
readonly IObservableGitHubClient _github;
public TheGetAllRepositoriesForCurrentMethod()
{
// Authenticate as a GitHubApp Installation
_github = new ObservableGitHubClient(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 IObservableGitHubClient _github;
public TheGetAllRepositoriesForCurrentUserMethod()
{
// Need to Authenticate as User to Server but not possible without receiving redirect from github.com
//_github = new ObservableGitHubClient(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);
}
}
}
}