mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-07 12:26:18 +00:00
Merge from master
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user