Merge from master

This commit is contained in:
Mordechai Zuber
2016-02-16 08:38:51 +02:00
60 changed files with 2429 additions and 27 deletions
@@ -20,7 +20,7 @@ namespace Octokit.Tests.Integration
if (Helper.Credentials == null)
return Enumerable.Empty<IXunitTestCase>();
if (!Helper.IsGitHubEnterprise)
if (!EnterpriseHelper.IsGitHubEnterpriseEnabled)
return Enumerable.Empty<IXunitTestCase>();
return new[] { new XunitTestCase(diagnosticMessageSink, discoveryOptions.MethodDisplayOrDefault(), testMethod) };
@@ -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);
}
}
}