/// <summary>
 /// Instantiates a new GitHub Enterprise API client.
 /// </summary>
 /// <param name="apiConnection">An API connection</param>
 public EnterpriseClient(IApiConnection apiConnection) : base(apiConnection)
 {
     AdminStats = new EnterpriseAdminStatsClient(apiConnection);
     License = new EnterpriseLicenseClient(apiConnection);
     Organization = new EnterpriseOrganizationClient(apiConnection);
     SearchIndexing = new EnterpriseSearchIndexingClient(apiConnection);
 }
示例#2
0
            public async Task EnsuresNonNullArguments()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new EnterpriseOrganizationClient(connection);

                await Assert.ThrowsAsync <ArgumentNullException>(() => client.Create(null));
            }
            public async Task EnsuresNonNullArguments()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new EnterpriseOrganizationClient(connection);

                await Assert.ThrowsAsync<ArgumentNullException>(() => client.Create(null));
            }
示例#4
0
 /// <summary>
 /// Instantiates a new GitHub Enterprise API client.
 /// </summary>
 /// <param name="apiConnection">An API connection</param>
 public EnterpriseClient(IApiConnection apiConnection) : base(apiConnection)
 {
     AdminStats     = new EnterpriseAdminStatsClient(apiConnection);
     License        = new EnterpriseLicenseClient(apiConnection);
     Organization   = new EnterpriseOrganizationClient(apiConnection);
     SearchIndexing = new EnterpriseSearchIndexingClient(apiConnection);
 }
示例#5
0
 /// <summary>
 /// Instantiates a new GitHub Enterprise API client.
 /// </summary>
 /// <param name="apiConnection">An API connection</param>
 public EnterpriseClient(IApiConnection apiConnection) : base(apiConnection)
 {
     AdminStats            = new EnterpriseAdminStatsClient(apiConnection);
     Ldap                  = new EnterpriseLdapClient(apiConnection);
     License               = new EnterpriseLicenseClient(apiConnection);
     Organization          = new EnterpriseOrganizationClient(apiConnection);
     SearchIndexing        = new EnterpriseSearchIndexingClient(apiConnection);
     PreReceiveEnvironment = new EnterprisePreReceiveEnvironmentsClient(apiConnection);
 }
            public void RequestsCorrectUrl()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new EnterpriseOrganizationClient(connection);

                string expectedUri = "admin/organizations";
                client.Create(new NewOrganization("org", "admin", "org name"));

                connection.Received().Post<Organization>(Arg.Is<Uri>(u => u.ToString() == expectedUri), Arg.Any<object>());
            }
示例#7
0
            public void RequestsCorrectUrl()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new EnterpriseOrganizationClient(connection);

                string expectedUri = "admin/organizations";

                client.Create(new NewOrganization("org", "admin", "org name"));

                connection.Received().Post <Organization>(Arg.Is <Uri>(u => u.ToString() == expectedUri), Arg.Any <object>());
            }
示例#8
0
            public void PassesRequestObject()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new EnterpriseOrganizationClient(connection);

                client.Create(new NewOrganization("org", "admin", "org name"));

                connection.Received().Post <Organization>(
                    Arg.Any <Uri>(),
                    Arg.Is <NewOrganization>(a =>
                                             a.Login == "org" &&
                                             a.Admin == "admin" &&
                                             a.ProfileName == "org name"));
            }
            public void PassesRequestObject()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new EnterpriseOrganizationClient(connection);

                client.Create(new NewOrganization("org", "admin", "org name"));

                connection.Received().Post<Organization>(
                    Arg.Any<Uri>(),
                    Arg.Is<NewOrganization>(a =>
                        a.Login == "org"
                        && a.Admin == "admin"
                        && a.ProfileName == "org name"));
            }