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);
        }
Esempio n. 2
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;
     CommitStatus = new ObservableCommitStatusClient(client);
 }
        public ObservableRepositoriesClient(IGitHubClient client)
        {
            Ensure.ArgumentNotNull(client, "client");

            _client      = client.Repository;
            _connection  = client.Connection;
            CommitStatus = new ObservableCommitStatusClient(client);
        }
            public void RequestsCorrectUrlWithRepositoryId()
            {
                var gitHubClient = Substitute.For<IGitHubClient>();
                var client = new ObservableCommitStatusClient(gitHubClient);

                client.GetAll(1, "sha");

                gitHubClient.Received().Repository.Status.GetAll(1, "sha");
            }
 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 void RequestsCorrectUrlWithApiOptionsWithRepositoryId()
            {
                var connection = Substitute.For<IGitHubClient>();
                var client = new ObservableCommitStatusClient(connection);

                var options = new ApiOptions
                {
                    PageSize = 1,
                    PageCount = 1,
                    StartPage = 1
                };

                client.GetAll(1, "sha", options);

                connection.Received().Repository.Status.GetAll(1, "sha", options);
            }
        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 void EnsuresNonNullArguments()
            {
                var client = new ObservableCommitStatusClient(Substitute.For<IGitHubClient>());

                Assert.Throws<ArgumentNullException>(() => client.GetAll(null, "name", "sha"));
                Assert.Throws<ArgumentNullException>(() => client.GetAll("owner", null, "sha"));
                Assert.Throws<ArgumentNullException>(() => client.GetAll("owner", "name", null));
                Assert.Throws<ArgumentNullException>(() => client.GetAll(null, "name", "sha", ApiOptions.None));
                Assert.Throws<ArgumentNullException>(() => client.GetAll("owner", null, "sha", ApiOptions.None));
                Assert.Throws<ArgumentNullException>(() => client.GetAll("owner", "name", null, ApiOptions.None));
                Assert.Throws<ArgumentNullException>(() => client.GetAll("owner", "name", "sha", null));

                Assert.Throws<ArgumentNullException>(() => client.GetAll(1, null));
                Assert.Throws<ArgumentNullException>(() => client.GetAll(1, "sha", null));

                Assert.Throws<ArgumentException>(() => client.GetAll("", "name", "sha"));
                Assert.Throws<ArgumentException>(() => client.GetAll("owner", "", "sha"));
                Assert.Throws<ArgumentException>(() => client.GetAll("owner", "name", ""));
                Assert.Throws<ArgumentException>(() => client.GetAll("", "name", "sha", ApiOptions.None));
                Assert.Throws<ArgumentException>(() => client.GetAll("owner", "", "sha", ApiOptions.None));
                Assert.Throws<ArgumentException>(() => client.GetAll("owner", "name", "", ApiOptions.None));

                Assert.Throws<ArgumentException>(() => client.GetAll(1, "", ApiOptions.None));
            }
            public void RequestsCorrectUrl()
            {
                var gitHubClient = Substitute.For<IGitHubClient>();
                var client = new ObservableCommitStatusClient(gitHubClient);

                client.GetCombined("fake", "repo", "sha");

                gitHubClient.Received().Repository.Status.GetCombined("fake", "repo", "sha");
            }
            public void EnsuresNonNullArguments()
            {
                var client = new ObservableCommitStatusClient(Substitute.For<IGitHubClient>());

                Assert.Throws<ArgumentNullException>(() => client.Create(null, "name", "sha", new NewCommitStatus()));
                Assert.Throws<ArgumentNullException>(() => client.Create("owner", null, "sha", new NewCommitStatus()));
                Assert.Throws<ArgumentNullException>(() => client.Create("owner", "name", null, new NewCommitStatus()));
                Assert.Throws<ArgumentNullException>(() => client.Create("owner", "name", "sha", null));

                Assert.Throws<ArgumentNullException>(() => client.Create(1, null, new NewCommitStatus()));
                Assert.Throws<ArgumentNullException>(() => client.Create(1, "sha", null));

                Assert.Throws<ArgumentException>(() => client.Create("", "name", "sha", new NewCommitStatus()));
                Assert.Throws<ArgumentException>(() => client.Create("owner", "", "sha", new NewCommitStatus()));
                Assert.Throws<ArgumentException>(() => client.Create("owner", "name", "", new NewCommitStatus()));

                Assert.Throws<ArgumentException>(() => client.Create(1, "", new NewCommitStatus()));
            }
            public void PostsToTheCorrectUrlWithRepositoryId()
            {
                var gitHubClient = Substitute.For<IGitHubClient>();
                var client = new ObservableCommitStatusClient(gitHubClient);

                var newCommitStatus = new NewCommitStatus { State = CommitState.Success };

                client.Create(1, "sha", newCommitStatus);

                gitHubClient.Received().Repository.Status.Create(1, "sha", newCommitStatus);
            }
 public TheGetAllMethod()
 {
     var github = Helper.GetAuthenticatedClient();
     _commitStatusClient = new ObservableCommitStatusClient(github);
 }