/// <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); }
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)); }
/// <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>()); }
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>()); }
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")); }