/// <summary> /// Initializes a new GitHub Repos API client. /// </summary> /// <param name="apiConnection">An API connection</param> public RepositoriesClient(IApiConnection apiConnection) : base(apiConnection) { Status = new CommitStatusClient(apiConnection); Hooks = new RepositoryHooksClient(apiConnection); Forks = new RepositoryForksClient(apiConnection); #pragma warning disable CS0618 // Type or member is obsolete RepoCollaborators = new RepoCollaboratorsClient(apiConnection); #pragma warning restore CS0618 // Type or member is obsolete Collaborator = new RepoCollaboratorsClient(apiConnection); Statistics = new StatisticsClient(apiConnection); Deployment = new DeploymentsClient(apiConnection); PullRequest = new PullRequestsClient(apiConnection); #pragma warning disable CS0618 // Type or member is obsolete RepositoryComments = new RepositoryCommentsClient(apiConnection); #pragma warning restore CS0618 // Type or member is obsolete Comment = new RepositoryCommentsClient(apiConnection); #pragma warning disable CS0618 // Type or member is obsolete Commits = new RepositoryCommitsClient(apiConnection); #pragma warning restore CS0618 // Type or member is obsolete Commit = new RepositoryCommitsClient(apiConnection); Release = new ReleasesClient(apiConnection); DeployKeys = new RepositoryDeployKeysClient(apiConnection); Merging = new MergingClient(apiConnection); Content = new RepositoryContentsClient(apiConnection); Page = new RepositoryPagesClient(apiConnection); }
/// <summary> /// Initializes a new GitHub Repos API client. /// </summary> /// <param name="apiConnection">An API connection</param> public RepositoriesClient(IApiConnection apiConnection) : base(apiConnection) { CommitStatus = new CommitStatusClient(apiConnection); RepoCollaborators = new RepoCollaboratorsClient(apiConnection); Statistics = new StatisticsClient(apiConnection); Deployment = new DeploymentsClient(apiConnection); PullRequest = new PullRequestsClient(apiConnection); RepositoryComments = new RepositoryCommentsClient(apiConnection); Commits = new RepositoryCommitsClient(apiConnection); }
/// <summary> /// Initializes a new GitHub Repos API client. /// </summary> /// <param name="apiConnection">An API connection</param> public RepositoriesClient(IApiConnection apiConnection) : base(apiConnection) { CommitStatus = new CommitStatusClient(apiConnection); Hooks = new RepositoryHooksClient(apiConnection); Forks = new RepositoryForksClient(apiConnection); RepoCollaborators = new RepoCollaboratorsClient(apiConnection); Statistics = new StatisticsClient(apiConnection); Deployment = new DeploymentsClient(apiConnection); PullRequest = new PullRequestsClient(apiConnection); RepositoryComments = new RepositoryCommentsClient(apiConnection); Commits = new RepositoryCommitsClient(apiConnection); DeployKeys = new RepositoryDeployKeysClient(apiConnection); Merging = new MergingClient(apiConnection); Content = new RepositoryContentsClient(apiConnection); }
/// <summary> /// Initializes a new GitHub Repos API client. /// </summary> /// <param name="apiConnection">An API connection</param> public RepositoriesClient(IApiConnection apiConnection) : base(apiConnection) { Status = new CommitStatusClient(apiConnection); Hooks = new RepositoryHooksClient(apiConnection); Forks = new RepositoryForksClient(apiConnection); Collaborator = new RepoCollaboratorsClient(apiConnection); Statistics = new StatisticsClient(apiConnection); Deployment = new DeploymentsClient(apiConnection); PullRequest = new PullRequestsClient(apiConnection); Comment = new RepositoryCommentsClient(apiConnection); Commit = new RepositoryCommitsClient(apiConnection); Release = new ReleasesClient(apiConnection); DeployKeys = new RepositoryDeployKeysClient(apiConnection); Merging = new MergingClient(apiConnection); Content = new RepositoryContentsClient(apiConnection); Page = new RepositoryPagesClient(apiConnection); Invitation = new RepositoryInvitationsClient(apiConnection); Branch = new RepositoryBranchesClient(apiConnection); }
/// <summary> /// Initializes a new GitHub Repos API client. /// </summary> /// <param name="apiConnection">An API connection</param> public RepositoriesClient(IApiConnection apiConnection) : base(apiConnection) { CommitStatus = new CommitStatusClient(apiConnection); Hooks = new RepositoryHooksClient(apiConnection); Forks = new RepositoryForksClient(apiConnection); #pragma warning disable CS0618 // Type or member is obsolete RepoCollaborators = new RepoCollaboratorsClient(apiConnection); #pragma warning restore CS0618 // Type or member is obsolete Collaborator = new RepoCollaboratorsClient(apiConnection); Statistics = new StatisticsClient(apiConnection); Deployment = new DeploymentsClient(apiConnection); PullRequest = new PullRequestsClient(apiConnection); #pragma warning disable CS0618 // Type or member is obsolete RepositoryComments = new RepositoryCommentsClient(apiConnection); #pragma warning restore CS0618 // Type or member is obsolete Comment = new RepositoryCommentsClient(apiConnection); Commits = new RepositoryCommitsClient(apiConnection); DeployKeys = new RepositoryDeployKeysClient(apiConnection); Merging = new MergingClient(apiConnection); Content = new RepositoryContentsClient(apiConnection); }
public void GetsCorrectUrl() { var connection = Substitute.For<IApiConnection>(); var client = new RepositoryCommitsClient(connection); client.GetAll("owner", "name"); connection.Received() .GetAll<GitHubCommit>(Arg.Is<Uri>(u => u.ToString() == "repos/owner/name/commits"), Arg.Any<Dictionary<string, string>>()); }
public void EnsureNonNullArguments() { var client = new RepositoryCommitsClient(Substitute.For<IApiConnection>()); Assert.Throws<ArgumentNullException>(() => client.GetAll(null, "repo")); Assert.Throws<ArgumentException>(() => client.GetAll("", "repo")); Assert.Throws<ArgumentNullException>(() => client.GetAll("owner", null)); Assert.Throws<ArgumentException>(() => client.GetAll("owner", "")); Assert.Throws<ArgumentNullException>(() => client.GetAll("owner", "repo", null)); }
public void GetsCorrectUrl() { var connection = Substitute.For<IApiConnection>(); var client = new RepositoryCommitsClient(connection); client.Get("owner", "name", "reference"); connection.Received() .Get<GitHubCommit>(Arg.Is<Uri>(u => u.ToString() == "repos/owner/name/commits/reference"), null); }
public void EncodesUrl() { var connection = Substitute.For<IApiConnection>(); var client = new RepositoryCommitsClient(connection); client.Compare("owner", "repo", "base", "shiftkey/my-cool-branch"); connection.Received() .Get<CompareResult>(Arg.Is<Uri>(u => u.ToString() == "repos/owner/repo/compare/base...shiftkey%2Fmy-cool-branch"), null); }
public void GetsCorrectUrl() { var connection = Substitute.For<IApiConnection>(); var client = new RepositoryCommitsClient(connection); client.Compare("owner", "repo", "base", "head"); connection.Received() .Get<CompareResult>(Arg.Is<Uri>(u => u.ToString() == "repos/owner/repo/compare/base...head"), null); }
public async Task EnsureNonNullArguments() { var client = new RepositoryCommitsClient(Substitute.For<IApiConnection>()); await Assert.ThrowsAsync<ArgumentNullException>(() => client.Get(null, "repo", "reference")); await Assert.ThrowsAsync<ArgumentException>(() => client.Get("", "repo", "reference")); await Assert.ThrowsAsync<ArgumentNullException>(() => client.Get("owner", null, "reference")); await Assert.ThrowsAsync<ArgumentException>(() => client.Get("owner", "", "reference")); await Assert.ThrowsAsync<ArgumentNullException>(() => client.Get("owner", "repo", null)); await Assert.ThrowsAsync<ArgumentException>(() => client.Get("owner", "repo", "")); }