コード例 #1
0
        /// <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);
        }
コード例 #2
0
 /// <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);
 }
コード例 #3
0
 /// <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);
 }
コード例 #4
0
 /// <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);
 }
コード例 #5
0
 /// <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);
 }
コード例 #6
0
 /// <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);
 }
コード例 #7
0
        /// <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);
        }
コード例 #8
0
            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>>());
            }
コード例 #9
0
            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));
            }
コード例 #10
0
            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);
            }
コード例 #11
0
            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);
            }
コード例 #12
0
            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);
            }
コード例 #13
0
            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", ""));
            }