mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-22 07:05:12 +00:00
Add Reactive versions of organization API and unit/integration tests
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Reactive.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Octokit.Reactive;
|
||||
using Xunit;
|
||||
|
||||
namespace Octokit.Tests.Integration
|
||||
{
|
||||
public class ObservableEnterpriseOrganizationClientTests
|
||||
{
|
||||
readonly IObservableGitHubClient _github;
|
||||
|
||||
public ObservableEnterpriseOrganizationClientTests()
|
||||
{
|
||||
_github = new ObservableGitHubClient(EnterpriseHelper.GetAuthenticatedClient());
|
||||
}
|
||||
|
||||
[GitHubEnterpriseTest]
|
||||
public async Task CanCreateOrganization()
|
||||
{
|
||||
string orgLogin = Helper.MakeNameWithTimestamp("MyOrganization");
|
||||
string orgName = String.Concat(orgLogin, " Display Name");
|
||||
|
||||
var newOrganization = new NewOrganization(orgLogin, EnterpriseHelper.GHEUserName, orgName);
|
||||
var observable = _github.Enterprise.Organization.Create(newOrganization);
|
||||
var organization = await observable;
|
||||
|
||||
Assert.NotNull(organization);
|
||||
|
||||
// Get organization and check login/name
|
||||
var checkOrg = await _github.Organization.Get(orgLogin);
|
||||
Assert.Equal(checkOrg.Login, orgLogin);
|
||||
Assert.Equal(checkOrg.Name, orgName);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user