mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-05-30 09:49:04 +00:00
35 lines
1011 B
C#
35 lines
1011 B
C#
using System;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using Octokit;
|
|
using Octokit.Tests.Integration;
|
|
using Xunit;
|
|
|
|
public class EnterpriseOrganizationClientTests
|
|
{
|
|
readonly IGitHubClient _github;
|
|
|
|
public EnterpriseOrganizationClientTests()
|
|
{
|
|
_github = 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.UserName, orgName);
|
|
var organization = await
|
|
_github.Enterprise.Organization.Create(newOrganization);
|
|
|
|
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);
|
|
}
|
|
}
|