Implement Reactive Enterprise Search Indexing Client and unit/integration tests

This commit is contained in:
Ryan Gribble
2016-02-05 22:23:31 +10:00
committed by Ryan Gribble
parent b50b2c737f
commit a3b2a2fbda
10 changed files with 448 additions and 0 deletions

View File

@@ -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);
}
}
}