mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-20 22:25:12 +00:00
Implement Reactive Enterprise Search Indexing Client and unit/integration tests
This commit is contained in:
committed by
Ryan Gribble
parent
b50b2c737f
commit
a3b2a2fbda
@@ -0,0 +1,31 @@
|
||||
using Octokit.Reactive;
|
||||
using System.Threading.Tasks;
|
||||
using System.Reactive.Linq;
|
||||
|
||||
namespace Octokit.Tests.Integration.Helpers
|
||||
{
|
||||
internal static class ObservableGithubClientExtensions
|
||||
{
|
||||
internal async static Task<RepositoryContext> CreateRepositoryContext(this IObservableGitHubClient client, string repositoryName)
|
||||
{
|
||||
var repoName = Helper.MakeNameWithTimestamp(repositoryName);
|
||||
var repo = await client.Repository.Create(new NewRepository(repoName) { AutoInit = true });
|
||||
|
||||
return new RepositoryContext(repo);
|
||||
}
|
||||
|
||||
internal async static Task<RepositoryContext> CreateRepositoryContext(this IObservableGitHubClient client, string organizationLogin, NewRepository newRepository)
|
||||
{
|
||||
var repo = await client.Repository.Create(organizationLogin, newRepository);
|
||||
|
||||
return new RepositoryContext(repo);
|
||||
}
|
||||
|
||||
internal async static Task<RepositoryContext> CreateRepositoryContext(this IObservableGitHubClient client, NewRepository newRepository)
|
||||
{
|
||||
var repo = await client.Repository.Create(newRepository);
|
||||
|
||||
return new RepositoryContext(repo);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user