Example #1
0
        public ObservableRepositoriesClient(IGitHubClient client)
        {
            Ensure.ArgumentNotNull(client, nameof(client));

            _client      = client.Repository;
            _connection  = client.Connection;
            Status       = new ObservableCommitStatusClient(client);
            Hooks        = new ObservableRepositoryHooksClient(client);
            Forks        = new ObservableRepositoryForksClient(client);
            Collaborator = new ObservableRepoCollaboratorsClient(client);
            Deployment   = new ObservableDeploymentsClient(client);
            Statistics   = new ObservableStatisticsClient(client);
            PullRequest  = new ObservablePullRequestsClient(client);
            Branch       = new ObservableRepositoryBranchesClient(client);
            Comment      = new ObservableRepositoryCommentsClient(client);
            Commit       = new ObservableRepositoryCommitsClient(client);
            Release      = new ObservableReleasesClient(client);
            DeployKeys   = new ObservableRepositoryDeployKeysClient(client);
            Content      = new ObservableRepositoryContentsClient(client);
            Merging      = new ObservableMergingClient(client);
            Page         = new ObservableRepositoryPagesClient(client);
            Invitation   = new ObservableRepositoryInvitationsClient(client);
            Traffic      = new ObservableRepositoryTrafficClient(client);
            Project      = new ObservableProjectsClient(client);
        }
        public ObservableRepositoriesClient(IGitHubClient client)
        {
            Ensure.ArgumentNotNull(client, "client");

            _client     = client.Repository;
            _connection = client.Connection;
            Status      = new ObservableCommitStatusClient(client);
            Hooks       = new ObservableRepositoryHooksClient(client);
            Forks       = new ObservableRepositoryForksClient(client);
#pragma warning disable CS0618 // Type or member is obsolete
            RepoCollaborators = new ObservableRepoCollaboratorsClient(client);
#pragma warning restore CS0618 // Type or member is obsolete
            Collaborator = new ObservableRepoCollaboratorsClient(client);
            Deployment   = new ObservableDeploymentsClient(client);
            Statistics   = new ObservableStatisticsClient(client);
            PullRequest  = new ObservablePullRequestsClient(client);
#pragma warning disable CS0618 // Type or member is obsolete
            RepositoryComments = new ObservableRepositoryCommentsClient(client);
#pragma warning restore CS0618 // Type or member is obsolete
            Comment = new ObservableRepositoryCommentsClient(client);
#pragma warning disable CS0618 // Type or member is obsolete
            Commits = new ObservableRepositoryCommitsClient(client);
#pragma warning restore CS0618 // Type or member is obsolete
            Commit     = new ObservableRepositoryCommitsClient(client);
            Release    = new ObservableReleasesClient(client);
            DeployKeys = new ObservableRepositoryDeployKeysClient(client);
            Content    = new ObservableRepositoryContentsClient(client);
            Merging    = new ObservableMergingClient(client);
            Page       = new ObservableRepositoryPagesClient(client);
        }
        public ObservableRepositoriesClient(IGitHubClient client)
        {
            Ensure.ArgumentNotNull(client, "client");

            _client = client.Repository;
            _connection = client.Connection;
            Status = new ObservableCommitStatusClient(client);
            Hooks = new ObservableRepositoryHooksClient(client);
            Forks = new ObservableRepositoryForksClient(client);
#pragma warning disable CS0618 // Type or member is obsolete
            RepoCollaborators = new ObservableRepoCollaboratorsClient(client);
#pragma warning restore CS0618 // Type or member is obsolete
            Collaborator = new ObservableRepoCollaboratorsClient(client);
            Deployment = new ObservableDeploymentsClient(client);
            Statistics = new ObservableStatisticsClient(client);
            PullRequest = new ObservablePullRequestsClient(client);
#pragma warning disable CS0618 // Type or member is obsolete
            RepositoryComments = new ObservableRepositoryCommentsClient(client);
#pragma warning restore CS0618 // Type or member is obsolete
            Comment = new ObservableRepositoryCommentsClient(client);
#pragma warning disable CS0618 // Type or member is obsolete
            Commits = new ObservableRepositoryCommitsClient(client);
#pragma warning restore CS0618 // Type or member is obsolete
            Commit = new ObservableRepositoryCommitsClient(client);
            Release = new ObservableReleasesClient(client);
            DeployKeys = new ObservableRepositoryDeployKeysClient(client);
            Content = new ObservableRepositoryContentsClient(client);
            Merging = new ObservableMergingClient(client);
            Page = new ObservableRepositoryPagesClient(client);
        }
            public void GetsFromClientIssueMilestone()
            {
                var gitHubClient = Substitute.For<IGitHubClient>();
                var statisticsClient = new ObservableStatisticsClient(gitHubClient);

                statisticsClient.GetContributors("username", "repositoryName");

                gitHubClient.Repository.Statistics.Received().GetContributors("username", "repositoryName");
            }
            public void RequestsCorrectUrlWithRepositoryId()
            {
                var gitHubClient = Substitute.For<IGitHubClient>();
                var statisticsClient = new ObservableStatisticsClient(gitHubClient);

                statisticsClient.GetCommitActivity(1);

                gitHubClient.Repository.Statistics.Received().GetCommitActivity(1);
            }
            public void RequestsCorrectUrl()
            {
                var gitHubClient = Substitute.For<IGitHubClient>();
                var statisticsClient = new ObservableStatisticsClient(gitHubClient);

                statisticsClient.GetContributors("owner", "name");

                gitHubClient.Repository.Statistics.Received().GetContributors("owner", "name");
            }
            public void EnsureNonNullArguments()
            {
                var client = new ObservableStatisticsClient(Substitute.For<IGitHubClient>());

                Assert.Throws<ArgumentNullException>(() => client.GetCommitActivity("owner", null));
                Assert.Throws<ArgumentNullException>(() => client.GetCommitActivity(null, "name"));

                Assert.Throws<ArgumentException>(() => client.GetCommitActivity("", "name"));
                Assert.Throws<ArgumentException>(() => client.GetCommitActivity("owner", ""));
            }
 public ObservableRepositoriesClient(IGitHubClient client)
 {
     Ensure.ArgumentNotNull(client, "client");
     
     _client = client.Repository;
     _connection = client.Connection;
     CommitStatus = new ObservableCommitStatusClient(client);
     RepoCollaborators = new ObservableRepoCollaboratorsClient(client);
     Deployment = new ObservableDeploymentsClient(client);
     Statistics = new ObservableStatisticsClient(client);
     PullRequest = new ObservablePullRequestsClient(client);
 }
        public ObservableRepositoriesClient(IGitHubClient client)
        {
            Ensure.ArgumentNotNull(client, "client");

            _client           = client.Repository;
            _connection       = client.Connection;
            CommitStatus      = new ObservableCommitStatusClient(client);
            RepoCollaborators = new ObservableRepoCollaboratorsClient(client);
            Deployment        = new ObservableDeploymentsClient(client);
            Statistics        = new ObservableStatisticsClient(client);
            PullRequest       = new ObservablePullRequestsClient(client);
        }
        public ObservableRepositoriesClient(IGitHubClient client)
        {
            Ensure.ArgumentNotNull(client, "client");

            _client = client.Repository;
            _connection = client.Connection;
            Status = new ObservableCommitStatusClient(client);
            Hooks = new ObservableRepositoryHooksClient(client);
            Forks = new ObservableRepositoryForksClient(client);
            Collaborator = new ObservableRepoCollaboratorsClient(client);
            Deployment = new ObservableDeploymentsClient(client);
            Statistics = new ObservableStatisticsClient(client);
            PullRequest = new ObservablePullRequestsClient(client);
            Comment = new ObservableRepositoryCommentsClient(client);
            Commit = new ObservableRepositoryCommitsClient(client);
            Release = new ObservableReleasesClient(client);
            DeployKeys = new ObservableRepositoryDeployKeysClient(client);
            Content = new ObservableRepositoryContentsClient(client);
            Merging = new ObservableMergingClient(client);
            Page = new ObservableRepositoryPagesClient(client);
            Invitation = new ObservableRepositoryInvitationsClient(client);
        }
 public async Task ThrowsIfGivenNullOwnerName()
 {
     var statisticsClient = new ObservableStatisticsClient(Substitute.For<IGitHubClient>());
     await Assert.ThrowsAsync<ArgumentNullException>(() => statisticsClient.GetContributors(null, "repositoryName").ToTask());
 }
 public async Task ThrowsIfGivenNullRepositoryName()
 {   
     var statisticsClient = new ObservableStatisticsClient(Substitute.For<IGitHubClient>());
     await AssertEx.Throws<ArgumentNullException>(async () => await statisticsClient.GetContributors("owner", null));
 }