From c48e9b02809d78e1bbf368c1fd727858a86afa85 Mon Sep 17 00:00:00 2001 From: Alexander Efremov Date: Sun, 12 Jun 2016 13:00:43 +0700 Subject: [PATCH 1/8] modified XML docs --- .../Clients/IObservableDeploymentStatusClient.cs | 13 ++++++++++--- .../Clients/ObservableDeploymentStatusClient.cs | 13 ++++++++++--- Octokit/Clients/DeploymentStatusClient.cs | 6 +++--- Octokit/Clients/IDeploymentStatusClient.cs | 6 +++--- 4 files changed, 26 insertions(+), 12 deletions(-) diff --git a/Octokit.Reactive/Clients/IObservableDeploymentStatusClient.cs b/Octokit.Reactive/Clients/IObservableDeploymentStatusClient.cs index 2b67fae7..b069eade 100644 --- a/Octokit.Reactive/Clients/IObservableDeploymentStatusClient.cs +++ b/Octokit.Reactive/Clients/IObservableDeploymentStatusClient.cs @@ -2,6 +2,13 @@ using System; namespace Octokit.Reactive { + /// + /// A client for GitHub's Repository Deployment Statuses API. + /// Gets and creates Deployment Statuses. + /// + /// + /// See the Repository Deployment Statuses API documentation for more information. + /// public interface IObservableDeploymentStatusClient { /// @@ -14,7 +21,7 @@ namespace Octokit.Reactive /// The owner of the repository. /// The name of the repository. /// The id of the deployment. - /// All deployment statuses for the given deployment. + /// A of es for the given deployment. IObservable GetAll(string owner, string name, int deploymentId); /// @@ -28,7 +35,7 @@ namespace Octokit.Reactive /// The name of the repository. /// The id of the deployment. /// Options for changing the API response - /// All deployment statuses for the given deployment. + /// A of es for the given deployment. IObservable GetAll(string owner, string name, int deploymentId, ApiOptions options); /// @@ -42,7 +49,7 @@ namespace Octokit.Reactive /// The name of the repository. /// The id of the deployment. /// The new deployment status to create. - /// + /// A representing created deployment status. IObservable Create(string owner, string name, int deploymentId, NewDeploymentStatus newDeploymentStatus); } } \ No newline at end of file diff --git a/Octokit.Reactive/Clients/ObservableDeploymentStatusClient.cs b/Octokit.Reactive/Clients/ObservableDeploymentStatusClient.cs index 8295f6b0..3da21c7b 100644 --- a/Octokit.Reactive/Clients/ObservableDeploymentStatusClient.cs +++ b/Octokit.Reactive/Clients/ObservableDeploymentStatusClient.cs @@ -4,6 +4,13 @@ using Octokit.Reactive.Internal; namespace Octokit.Reactive.Clients { + /// + /// A client for GitHub's Repository Deployment Statuses API. + /// Gets and creates Deployment Statuses. + /// + /// + /// See the Repository Deployment Statuses API documentation for more information. + /// public class ObservableDeploymentStatusClient : IObservableDeploymentStatusClient { private readonly IDeploymentStatusClient _client; @@ -27,7 +34,7 @@ namespace Octokit.Reactive.Clients /// The owner of the repository. /// The name of the repository. /// The id of the deployment. - /// All deployment statuses for the given deployment. + /// A of es for the given deployment. public IObservable GetAll(string owner, string name, int deploymentId) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -47,7 +54,7 @@ namespace Octokit.Reactive.Clients /// The name of the repository. /// The id of the deployment. /// Options for changing the API response - /// All deployment statuses for the given deployment. + /// A of es for the given deployment. public IObservable GetAll(string owner, string name, int deploymentId, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -69,7 +76,7 @@ namespace Octokit.Reactive.Clients /// The name of the repository. /// The id of the deployment. /// The new deployment status to create. - /// + /// A representing created deployment status. public IObservable Create(string owner, string name, int deploymentId, NewDeploymentStatus newDeploymentStatus) { return _client.Create(owner, name, deploymentId, newDeploymentStatus).ToObservable(); diff --git a/Octokit/Clients/DeploymentStatusClient.cs b/Octokit/Clients/DeploymentStatusClient.cs index 7495c462..9b12c99d 100644 --- a/Octokit/Clients/DeploymentStatusClient.cs +++ b/Octokit/Clients/DeploymentStatusClient.cs @@ -27,7 +27,7 @@ namespace Octokit /// The owner of the repository. /// The name of the repository. /// The id of the deployment. - /// All deployment statuses for the given deployment. + /// A of es for the given deployment. public Task> GetAll(string owner, string name, int deploymentId) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -47,7 +47,7 @@ namespace Octokit /// The name of the repository. /// The id of the deployment. /// Options for changing the API response - /// All deployment statuses for the given deployment. + /// A of es for the given deployment. public Task> GetAll(string owner, string name, int deploymentId, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -71,7 +71,7 @@ namespace Octokit /// The name of the repository. /// The id of the deployment. /// - /// + /// A representing created deployment status. public Task Create(string owner, string name, int deploymentId, NewDeploymentStatus newDeploymentStatus) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); diff --git a/Octokit/Clients/IDeploymentStatusClient.cs b/Octokit/Clients/IDeploymentStatusClient.cs index 077c17c1..cead485e 100644 --- a/Octokit/Clients/IDeploymentStatusClient.cs +++ b/Octokit/Clients/IDeploymentStatusClient.cs @@ -22,7 +22,7 @@ namespace Octokit /// The owner of the repository. /// The name of the repository. /// The id of the deployment. - /// All deployment statuses for the given deployment. + /// A of es for the given deployment. Task> GetAll(string owner, string name, int deploymentId); /// @@ -36,7 +36,7 @@ namespace Octokit /// The name of the repository. /// The id of the deployment. /// Options for changing the API response - /// All deployment statuses for the given deployment. + /// A of es for the given deployment. Task> GetAll(string owner, string name, int deploymentId, ApiOptions options); /// @@ -50,7 +50,7 @@ namespace Octokit /// The name of the repository. /// The id of the deployment. /// - /// + /// A representing created deployment status. Task Create(string owner, string name, int deploymentId, NewDeploymentStatus newDeploymentStatus); } } \ No newline at end of file From 686486a2058e369ae442b8371be55d14269084b7 Mon Sep 17 00:00:00 2001 From: Alexander Efremov Date: Sun, 12 Jun 2016 13:08:10 +0700 Subject: [PATCH 2/8] added new overloads --- .../IObservableDeploymentStatusClient.cs | 40 +++++++++++++- .../ObservableDeploymentStatusClient.cs | 54 +++++++++++++++++++ Octokit/Clients/DeploymentStatusClient.cs | 52 ++++++++++++++++++ Octokit/Clients/IDeploymentStatusClient.cs | 38 +++++++++++++ 4 files changed, 183 insertions(+), 1 deletion(-) diff --git a/Octokit.Reactive/Clients/IObservableDeploymentStatusClient.cs b/Octokit.Reactive/Clients/IObservableDeploymentStatusClient.cs index b069eade..7114e7df 100644 --- a/Octokit.Reactive/Clients/IObservableDeploymentStatusClient.cs +++ b/Octokit.Reactive/Clients/IObservableDeploymentStatusClient.cs @@ -24,6 +24,18 @@ namespace Octokit.Reactive /// A of es for the given deployment. IObservable GetAll(string owner, string name, int deploymentId); + /// + /// Gets all the statuses for the given deployment. Any user with pull access to a repository can + /// view deployments. + /// + /// + /// http://developer.github.com/v3/repos/deployments/#list-deployment-statuses + /// + /// The ID of the repository. + /// The id of the deployment. + /// A of es for the given deployment. + IObservable GetAll(int repositoryId, int deploymentId); + /// /// Gets all the statuses for the given deployment. Any user with pull access to a repository can /// view deployments. @@ -38,6 +50,19 @@ namespace Octokit.Reactive /// A of es for the given deployment. IObservable GetAll(string owner, string name, int deploymentId, ApiOptions options); + /// + /// Gets all the statuses for the given deployment. Any user with pull access to a repository can + /// view deployments. + /// + /// + /// http://developer.github.com/v3/repos/deployments/#list-deployment-statuses + /// + /// The ID of the repository. + /// The id of the deployment. + /// Options for changing the API response + /// A of es for the given deployment. + IObservable GetAll(int repositoryId, int deploymentId, ApiOptions options); + /// /// Creates a new status for the given deployment. Users with push access can create deployment /// statuses for a given deployment. @@ -51,5 +76,18 @@ namespace Octokit.Reactive /// The new deployment status to create. /// A representing created deployment status. IObservable Create(string owner, string name, int deploymentId, NewDeploymentStatus newDeploymentStatus); + + /// + /// Creates a new status for the given deployment. Users with push access can create deployment + /// statuses for a given deployment. + /// + /// + /// http://developer.github.com/v3/repos/deployments/#create-a-deployment-status + /// + /// The ID of the repository. + /// The id of the deployment. + /// The new deployment status to create. + /// A representing created deployment status. + IObservable Create(int repositoryId, int deploymentId, NewDeploymentStatus newDeploymentStatus); } -} \ No newline at end of file +} diff --git a/Octokit.Reactive/Clients/ObservableDeploymentStatusClient.cs b/Octokit.Reactive/Clients/ObservableDeploymentStatusClient.cs index 3da21c7b..e94ca694 100644 --- a/Octokit.Reactive/Clients/ObservableDeploymentStatusClient.cs +++ b/Octokit.Reactive/Clients/ObservableDeploymentStatusClient.cs @@ -43,6 +43,21 @@ namespace Octokit.Reactive.Clients return GetAll(owner, name, deploymentId, ApiOptions.None); } + /// + /// Gets all the statuses for the given deployment. Any user with pull access to a repository can + /// view deployments. + /// + /// + /// http://developer.github.com/v3/repos/deployments/#list-deployment-statuses + /// + /// The ID of the repository. + /// The id of the deployment. + /// A of es for the given deployment. + public IObservable GetAll(int repositoryId, int deploymentId) + { + return GetAll(repositoryId, deploymentId, ApiOptions.None); + } + /// /// Gets all the statuses for the given deployment. Any user with pull access to a repository can /// view deployments. @@ -65,6 +80,25 @@ namespace Octokit.Reactive.Clients ApiUrls.DeploymentStatuses(owner, name, deploymentId), options); } + /// + /// Gets all the statuses for the given deployment. Any user with pull access to a repository can + /// view deployments. + /// + /// + /// http://developer.github.com/v3/repos/deployments/#list-deployment-statuses + /// + /// The ID of the repository. + /// The id of the deployment. + /// Options for changing the API response + /// A of es for the given deployment. + public IObservable GetAll(int repositoryId, int deploymentId, ApiOptions options) + { + Ensure.ArgumentNotNull(options, "options"); + + return _connection.GetAndFlattenAllPages( + ApiUrls.DeploymentStatuses(repositoryId, deploymentId), options); + } + /// /// Creates a new status for the given deployment. Users with push access can create deployment /// statuses for a given deployment. @@ -79,7 +113,27 @@ namespace Octokit.Reactive.Clients /// A representing created deployment status. public IObservable Create(string owner, string name, int deploymentId, NewDeploymentStatus newDeploymentStatus) { + Ensure.ArgumentNotNull(newDeploymentStatus, "newDeploymentStatus"); + return _client.Create(owner, name, deploymentId, newDeploymentStatus).ToObservable(); } + + /// + /// Creates a new status for the given deployment. Users with push access can create deployment + /// statuses for a given deployment. + /// + /// + /// http://developer.github.com/v3/repos/deployments/#create-a-deployment-status + /// + /// The ID of the repository. + /// The id of the deployment. + /// The new deployment status to create. + /// A representing created deployment status. + public IObservable Create(int repositoryId, int deploymentId, NewDeploymentStatus newDeploymentStatus) + { + Ensure.ArgumentNotNull(newDeploymentStatus, "newDeploymentStatus"); + + return _client.Create(repositoryId, deploymentId, newDeploymentStatus).ToObservable(); + } } } diff --git a/Octokit/Clients/DeploymentStatusClient.cs b/Octokit/Clients/DeploymentStatusClient.cs index 9b12c99d..16f9aa93 100644 --- a/Octokit/Clients/DeploymentStatusClient.cs +++ b/Octokit/Clients/DeploymentStatusClient.cs @@ -36,6 +36,21 @@ namespace Octokit return GetAll(owner, name, deploymentId, ApiOptions.None); } + /// + /// Gets all the statuses for the given deployment. Any user with pull access to a repository can + /// view deployments. + /// + /// + /// http://developer.github.com/v3/repos/deployments/#list-deployment-statuses + /// + /// The ID of the repository. + /// The id of the deployment. + /// A of es for the given deployment. + public Task> GetAll(int repositoryId, int deploymentId) + { + return GetAll(repositoryId, deploymentId, ApiOptions.None); + } + /// /// Gets all the statuses for the given deployment. Any user with pull access to a repository can /// view deployments. @@ -60,6 +75,24 @@ namespace Octokit options); } + /// + /// Gets all the statuses for the given deployment. Any user with pull access to a repository can + /// view deployments. + /// + /// + /// http://developer.github.com/v3/repos/deployments/#list-deployment-statuses + /// + /// The ID of the repository. + /// The id of the deployment. + /// Options for changing the API response + /// A of es for the given deployment. + public Task> GetAll(int repositoryId, int deploymentId, ApiOptions options) + { + Ensure.ArgumentNotNull(options, "options"); + + return ApiConnection.GetAll(ApiUrls.DeploymentStatuses(repositoryId, deploymentId), options); + } + /// /// Creates a new status for the given deployment. Users with push access can create deployment /// statuses for a given deployment. @@ -82,5 +115,24 @@ namespace Octokit newDeploymentStatus, AcceptHeaders.DeploymentApiPreview); } + + /// + /// Creates a new status for the given deployment. Users with push access can create deployment + /// statuses for a given deployment. + /// + /// + /// http://developer.github.com/v3/repos/deployments/#create-a-deployment-status + /// + /// The ID of the repository. + /// The id of the deployment. + /// + /// A representing created deployment status. + public Task Create(int repositoryId, int deploymentId, NewDeploymentStatus newDeploymentStatus) + { + Ensure.ArgumentNotNull(newDeploymentStatus, "newDeploymentStatus"); + + return ApiConnection.Post(ApiUrls.DeploymentStatuses(repositoryId, deploymentId), + newDeploymentStatus); + } } } diff --git a/Octokit/Clients/IDeploymentStatusClient.cs b/Octokit/Clients/IDeploymentStatusClient.cs index cead485e..89085698 100644 --- a/Octokit/Clients/IDeploymentStatusClient.cs +++ b/Octokit/Clients/IDeploymentStatusClient.cs @@ -25,6 +25,18 @@ namespace Octokit /// A of es for the given deployment. Task> GetAll(string owner, string name, int deploymentId); + /// + /// Gets all the statuses for the given deployment. Any user with pull access to a repository can + /// view deployments. + /// + /// + /// http://developer.github.com/v3/repos/deployments/#list-deployment-statuses + /// + /// The ID of the repository. + /// The id of the deployment. + /// A of es for the given deployment. + Task> GetAll(int repositoryId, int deploymentId); + /// /// Gets all the statuses for the given deployment. Any user with pull access to a repository can /// view deployments. @@ -39,6 +51,19 @@ namespace Octokit /// A of es for the given deployment. Task> GetAll(string owner, string name, int deploymentId, ApiOptions options); + /// + /// Gets all the statuses for the given deployment. Any user with pull access to a repository can + /// view deployments. + /// + /// + /// http://developer.github.com/v3/repos/deployments/#list-deployment-statuses + /// + /// The ID of the repository. + /// The id of the deployment. + /// Options for changing the API response + /// A of es for the given deployment. + Task> GetAll(int repositoryId, int deploymentId, ApiOptions options); + /// /// Creates a new status for the given deployment. Users with push access can create deployment /// statuses for a given deployment. @@ -52,5 +77,18 @@ namespace Octokit /// /// A representing created deployment status. Task Create(string owner, string name, int deploymentId, NewDeploymentStatus newDeploymentStatus); + + /// + /// Creates a new status for the given deployment. Users with push access can create deployment + /// statuses for a given deployment. + /// + /// + /// http://developer.github.com/v3/repos/deployments/#create-a-deployment-status + /// + /// The ID of the repository. + /// The id of the deployment. + /// + /// A representing created deployment status. + Task Create(int repositoryId, int deploymentId, NewDeploymentStatus newDeploymentStatus); } } \ No newline at end of file From 6f55ca8af7a81a75a5f529172fb869ef35fa0c04 Mon Sep 17 00:00:00 2001 From: Alexander Efremov Date: Sun, 12 Jun 2016 13:26:12 +0700 Subject: [PATCH 3/8] added new unit tests --- .../Clients/DeploymentStatusClientTests.cs | 157 ++++++++++------- .../ObservableDeploymentStatusClientTests.cs | 158 +++++++++++------- 2 files changed, 193 insertions(+), 122 deletions(-) diff --git a/Octokit.Tests/Clients/DeploymentStatusClientTests.cs b/Octokit.Tests/Clients/DeploymentStatusClientTests.cs index 87c97bfb..ca84220d 100644 --- a/Octokit.Tests/Clients/DeploymentStatusClientTests.cs +++ b/Octokit.Tests/Clients/DeploymentStatusClientTests.cs @@ -10,6 +10,68 @@ public class DeploymentStatusClientTests { public class TheGetAllMethod { + [Fact] + public async Task RequestsCorrectUrl() + { + var connection = Substitute.For(); + var client = new DeploymentStatusClient(connection); + var expectedUrl = "repos/owner/name/deployments/1/statuses"; + + await client.GetAll("owner", "name", 1); + + connection.Received().GetAll(Arg.Is(u => u.ToString() == expectedUrl), Args.ApiOptions); + } + + [Fact] + public async Task RequestsCorrectUrlWithRepositoryId() + { + var connection = Substitute.For(); + var client = new DeploymentStatusClient(connection); + var expectedUrl = "repositories/1/deployments/1/statuses"; + + await client.GetAll(1, 1); + + connection.Received().GetAll(Arg.Is(u => u.ToString() == expectedUrl), Args.ApiOptions); + } + + [Fact] + public async Task RequestsCorrectUrlWithApiOptions() + { + var connection = Substitute.For(); + var client = new DeploymentStatusClient(connection); + var expectedUrl = "repos/owner/name/deployments/1/statuses"; + + var options = new ApiOptions + { + StartPage = 1, + PageCount = 1, + PageSize = 1 + }; + + await client.GetAll("owner", "name", 1, options); + + connection.Received().GetAll(Arg.Is(u => u.ToString() == expectedUrl), options); + } + + [Fact] + public async Task RequestsCorrectUrlWithRepositoryIdWithApiOptions() + { + var connection = Substitute.For(); + var client = new DeploymentStatusClient(connection); + var expectedUrl = "repositories/1/deployments/1/statuses"; + + var options = new ApiOptions + { + StartPage = 1, + PageCount = 1, + PageSize = 1 + }; + + await client.GetAll(1, 1, options); + + connection.Received().GetAll(Arg.Is(u => u.ToString() == expectedUrl), options); + } + [Fact] public async Task EnsuresNonNullArguments() { @@ -21,16 +83,11 @@ public class DeploymentStatusClientTests await Assert.ThrowsAsync(() => client.GetAll(null, "name", 1, ApiOptions.None)); await Assert.ThrowsAsync(() => client.GetAll("owner", null, 1, ApiOptions.None)); await Assert.ThrowsAsync(() => client.GetAll("owner", "name", 1, null)); - } - [Fact] - public async Task EnsuresNonEmptyArguments() - { - var client = new DeploymentStatusClient(Substitute.For()); + await Assert.ThrowsAsync(() => client.GetAll(1, 1, null)); await Assert.ThrowsAsync(() => client.GetAll("", "name", 1)); await Assert.ThrowsAsync(() => client.GetAll("owner", "", 1)); - await Assert.ThrowsAsync(() => client.GetAll("", "name", 1, ApiOptions.None)); await Assert.ThrowsAsync(() => client.GetAll("owner", "", 1, ApiOptions.None)); } @@ -51,61 +108,38 @@ public class DeploymentStatusClientTests await Assert.ThrowsAsync(() => client.GetAll(whitespace, "name", 1, ApiOptions.None)); await Assert.ThrowsAsync(() => client.GetAll("owner", whitespace, 1, ApiOptions.None)); } - - [Fact] - public void RequestsCorrectUrl() - { - var connection = Substitute.For(); - var client = new DeploymentStatusClient(connection); - var expectedUrl = "repos/owner/name/deployments/1/statuses"; - - client.GetAll("owner", "name", 1); - connection.Received().GetAll(Arg.Is(u => u.ToString() == expectedUrl), - Arg.Any>(), - Arg.Any(), - Args.ApiOptions); - } - - [Fact] - public void RequestsCorrectUrlWithApiOptions() - { - var connection = Substitute.For(); - var client = new DeploymentStatusClient(connection); - var expectedUrl = "repos/owner/name/deployments/1/statuses"; - - var options = new ApiOptions - { - StartPage = 1, - PageCount = 1, - PageSize = 1 - }; - - client.GetAll("owner", "name", 1, options); - connection.Received().GetAll(Arg.Is(u => u.ToString() == expectedUrl), - Arg.Any>(), - Arg.Any(), - options); - } - - [Fact] - public void RequestsCorrectUrlWithPreviewAcceptHeaders() - { - var connection = Substitute.For(); - var client = new DeploymentStatusClient(connection); - var expectedUrl = "repos/owner/name/deployments/1/statuses"; - - client.GetAll("owner", "name", 1); - connection.Received().GetAll(Arg.Is(u => u.ToString() == expectedUrl), - Arg.Any>(), - Arg.Is(a => a == AcceptHeaders.DeploymentApiPreview), - Args.ApiOptions); - } } public class TheCreateMethod { readonly NewDeploymentStatus newDeploymentStatus = new NewDeploymentStatus(DeploymentState.Success); + [Fact] + public void PostsToCorrectUrl() + { + var connection = Substitute.For(); + var client = new DeploymentStatusClient(connection); + var expectedUrl = "repos/owner/repo/deployments/1/statuses"; + + client.Create("owner", "repo", 1, newDeploymentStatus); + + connection.Received().Post(Arg.Is(u => u.ToString() == expectedUrl), + Arg.Any()); + } + + [Fact] + public void PostsToCorrectUrlWithRepositoryId() + { + var connection = Substitute.For(); + var client = new DeploymentStatusClient(connection); + var expectedUrl = "repositories/1/deployments/1/statuses"; + + client.Create(1, 1, newDeploymentStatus); + + connection.Received().Post(Arg.Is(u => u.ToString() == expectedUrl), + Arg.Any()); + } + [Fact] public async Task EnsuresNonNullArguments() { @@ -113,15 +147,12 @@ public class DeploymentStatusClientTests await Assert.ThrowsAsync(() => client.Create(null, "name", 1, newDeploymentStatus)); await Assert.ThrowsAsync(() => client.Create("owner", null, 1, newDeploymentStatus)); - } + await Assert.ThrowsAsync(() => client.Create("owner", "name", 1, null)); - [Fact] - public async Task EnsuresNonEmptyArguments() - { - var client = new DeploymentStatusClient(Substitute.For()); + await Assert.ThrowsAsync(() => client.Create(1, 1, null)); - await Assert.ThrowsAsync(() => client.GetAll("", "name", 1)); - await Assert.ThrowsAsync(() => client.GetAll("owner", "", 1)); + await Assert.ThrowsAsync(() => client.Create("", "name", 1, newDeploymentStatus)); + await Assert.ThrowsAsync(() => client.Create("owner", "", 1, newDeploymentStatus)); } [Theory] @@ -189,4 +220,4 @@ public class DeploymentStatusClientTests Assert.Throws(() => new DeploymentStatusClient(null)); } } -} \ No newline at end of file +} diff --git a/Octokit.Tests/Reactive/ObservableDeploymentStatusClientTests.cs b/Octokit.Tests/Reactive/ObservableDeploymentStatusClientTests.cs index 21567fba..6fd20001 100644 --- a/Octokit.Tests/Reactive/ObservableDeploymentStatusClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableDeploymentStatusClientTests.cs @@ -22,23 +22,85 @@ namespace Octokit.Tests.Reactive _client = new ObservableDeploymentStatusClient(_githubClient); } + [Fact] + public void RequestsCorrectUrl() + { + var expectedUri = string.Format("repos/{0}/{1}/deployments/{2}/statuses", "owner", "repo", 1); + + _client.GetAll("owner", "repo", 1); + + _githubClient.Connection.Received(1) + .Get>(Arg.Is(uri => uri.ToString() == expectedUri), + Args.EmptyDictionary, + null); + } + + [Fact] + public void RequestsCorrectUrlWithRepositoryId() + { + var expectedUri = string.Format("repositories/{0}/deployments/{1}/statuses", 1, 1); + + _client.GetAll(1, 1); + + _githubClient.Connection.Received(1) + .Get>(Arg.Is(uri => uri.ToString() == expectedUri), + Args.EmptyDictionary, + null); + } + + [Fact] + public void RequestsCorrectUrlWithApiOptions() + { + var expectedUri = string.Format("repos/{0}/{1}/deployments/{2}/statuses", "owner", "repo", 1); + + var options = new ApiOptions + { + StartPage = 1, + PageCount = 1, + PageSize = 1 + }; + + _client.GetAll("owner", "repo", 1, options); + + _githubClient.Connection.Received(1) + .Get>(Arg.Is(uri => uri.ToString() == expectedUri), + Arg.Is>(dictionary => dictionary.Count == 2), + null); + } + + [Fact] + public void RequestsCorrectUrlWithRepositoryIdWithApiOptions() + { + var expectedUri = string.Format("repositories/{0}/deployments/{1}/statuses", 1, 1); + + var options = new ApiOptions + { + StartPage = 1, + PageCount = 1, + PageSize = 1 + }; + + _client.GetAll(1, 1, options); + + _githubClient.Connection.Received(1) + .Get>(Arg.Is(uri => uri.ToString() == expectedUri), + Arg.Is>(dictionary => dictionary.Count == 2), + null); + } + [Fact] public void EnsuresNonNullArguments() { Assert.Throws(() => _client.GetAll(null, "repo", 1)); Assert.Throws(() => _client.GetAll("owner", null, 1)); - Assert.Throws(() => _client.GetAll(null, "repo", 1, ApiOptions.None)); Assert.Throws(() => _client.GetAll("owner", null, 1, ApiOptions.None)); Assert.Throws(() => _client.GetAll("owner", "repo", 1, null)); - } - [Fact] - public void EnsuresNonEmptyArguments() - { + Assert.Throws(() => _client.GetAll(1, 1, null)); + Assert.Throws(() => _client.GetAll("", "repo", 1)); Assert.Throws(() => _client.GetAll("owner", "", 1)); - Assert.Throws(() => _client.GetAll("", "repo", 1, ApiOptions.None)); Assert.Throws(() => _client.GetAll("owner", "", 1, ApiOptions.None)); } @@ -56,39 +118,6 @@ namespace Octokit.Tests.Reactive await AssertEx.ThrowsWhenGivenWhitespaceArgument( async whitespace => await _client.GetAll("owner", whitespace, 1, ApiOptions.None)); } - - [Fact] - public void RequestsCorrectUrl() - { - var expectedUri = ApiUrls.DeploymentStatuses("owner", "repo", 1); - - _client.GetAll("owner", "repo", 1); - - _githubClient.Connection.Received(1) - .Get>(Arg.Is(expectedUri), - Args.EmptyDictionary, - null); - } - - [Fact] - public void RequestsCorrectUrlWitApiOptions() - { - var expectedUri = ApiUrls.DeploymentStatuses("owner", "repo", 1); - - var options = new ApiOptions - { - StartPage = 1, - PageCount = 1, - PageSize = 1 - }; - - _client.GetAll("owner", "repo", 1, options); - - _githubClient.Connection.Received(1) - .Get>(Arg.Is(expectedUri), - Arg.Is>(dictionary => dictionary.Count == 2), - null); - } } public class TheCreateMethod @@ -109,18 +138,42 @@ namespace Octokit.Tests.Reactive } [Fact] - public async Task EnsuresNonNullArguments() + public void CallsIntoDeploymentStatusClient() { - SetupWithNonReactiveClient(); - Assert.Throws(() => _client.Create(null, "repo", 1, new NewDeploymentStatus(DeploymentState.Success))); - Assert.Throws(() => _client.Create("owner", null, 1, new NewDeploymentStatus(DeploymentState.Success))); - Assert.Throws(() => _client.Create("owner", "repo", 1, null)); + SetupWithoutNonReactiveClient(); + + var newStatus = new NewDeploymentStatus(DeploymentState.Success); + + _client.Create("owner", "repo", 1, newStatus); + + _githubClient.Repository.Deployment.Status.Received(1) + .Create("owner", "repo", 1, newStatus); } [Fact] - public async Task EnsuresNonEmptyArguments() + public void CallsIntoDeploymentStatusClientWithRepositoryId() + { + SetupWithoutNonReactiveClient(); + + var newStatus = new NewDeploymentStatus(DeploymentState.Success); + + _client.Create(1, 1, newStatus); + + _githubClient.Repository.Deployment.Status.Received(1) + .Create(1, 1, newStatus); + } + + [Fact] + public async Task EnsuresNonNullArguments() { SetupWithNonReactiveClient(); + + Assert.Throws(() => _client.Create(null, "repo", 1, new NewDeploymentStatus(DeploymentState.Success))); + Assert.Throws(() => _client.Create("owner", null, 1, new NewDeploymentStatus(DeploymentState.Success))); + Assert.Throws(() => _client.Create("owner", "repo", 1, null)); + + Assert.Throws(() => _client.Create(1, 1, null)); + Assert.Throws(() => _client.Create("", "repo", 1, new NewDeploymentStatus(DeploymentState.Success))); Assert.Throws(() => _client.Create("owner", "", 1, new NewDeploymentStatus(DeploymentState.Success))); } @@ -129,25 +182,12 @@ namespace Octokit.Tests.Reactive public async Task EnsureNonWhitespaceArguments() { SetupWithNonReactiveClient(); + await AssertEx.ThrowsWhenGivenWhitespaceArgument( async whitespace => await _client.Create(whitespace, "repo", 1, new NewDeploymentStatus(DeploymentState.Success))); await AssertEx.ThrowsWhenGivenWhitespaceArgument( async whitespace => await _client.Create("owner", whitespace, 1, new NewDeploymentStatus(DeploymentState.Success))); } - - [Fact] - public void CallsIntoDeploymentStatusClient() - { - SetupWithoutNonReactiveClient(); - - var newStatus = new NewDeploymentStatus(DeploymentState.Success); - _client.Create("owner", "repo", 1, newStatus); - _githubClient.Repository.Deployment.Status.Received(1) - .Create(Arg.Is("owner"), - Arg.Is("repo"), - Arg.Is(1), - Arg.Is(newStatus)); - } } public class TheCtor From c439ae82356e126f597a4c985e9bbd26b3f76263 Mon Sep 17 00:00:00 2001 From: Alexander Efremov Date: Sun, 12 Jun 2016 13:31:58 +0700 Subject: [PATCH 4/8] added new integration tests --- .../Clients/DeploymentStatusClientTests.cs | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) diff --git a/Octokit.Tests.Integration/Clients/DeploymentStatusClientTests.cs b/Octokit.Tests.Integration/Clients/DeploymentStatusClientTests.cs index 49ee43ef..4c6ae338 100644 --- a/Octokit.Tests.Integration/Clients/DeploymentStatusClientTests.cs +++ b/Octokit.Tests.Integration/Clients/DeploymentStatusClientTests.cs @@ -55,6 +55,17 @@ public class DeploymentStatusClientTests : IDisposable Assert.Equal(DeploymentState.Success, status.State); } + [IntegrationTest] + public async Task CanCreateDeploymentStatusWithRepositoryId() + { + var newStatus = new NewDeploymentStatus(DeploymentState.Success); + + var status = await _deploymentsClient.Status.Create(_context.Repository.Id, _deployment.Id, newStatus); + + Assert.NotNull(status); + Assert.Equal(DeploymentState.Success, status.State); + } + [IntegrationTest] public async Task CanReadDeploymentStatuses() { @@ -69,6 +80,18 @@ public class DeploymentStatusClientTests : IDisposable Assert.Equal(newStatus.EnvironmentUrl, statuses[0].EnvironmentUrl); } + [IntegrationTest] + public async Task CanReadDeploymentStatusesWithRepositoryId() + { + var newStatus = new NewDeploymentStatus(DeploymentState.Success); + await _deploymentsClient.Status.Create(_context.Repository.Id, _deployment.Id, newStatus); + + var statuses = await _deploymentsClient.Status.GetAll(_context.Repository.Id, _deployment.Id); + + Assert.NotEmpty(statuses); + Assert.Equal(DeploymentState.Success, statuses[0].State); + } + [IntegrationTest] public async Task ReturnsCorrectCountOfDeploymentStatusesWithoutStart() { @@ -90,6 +113,27 @@ public class DeploymentStatusClientTests : IDisposable Assert.Equal(3, deploymentStatuses.Count); } + [IntegrationTest] + public async Task ReturnsCorrectCountOfDeploymentStatusesWithoutStartWithRepositoryId() + { + var newStatus1 = new NewDeploymentStatus(DeploymentState.Success); + var newStatus2 = new NewDeploymentStatus(DeploymentState.Success); + var newStatus3 = new NewDeploymentStatus(DeploymentState.Success); + await _deploymentsClient.Status.Create(_context.Repository.Id, _deployment.Id, newStatus1); + await _deploymentsClient.Status.Create(_context.Repository.Id, _deployment.Id, newStatus2); + await _deploymentsClient.Status.Create(_context.Repository.Id, _deployment.Id, newStatus3); + + var options = new ApiOptions + { + PageSize = 3, + PageCount = 1 + }; + + var deploymentStatuses = await _deploymentsClient.Status.GetAll(_context.Repository.Id, _deployment.Id, options); + + Assert.Equal(3, deploymentStatuses.Count); + } + [IntegrationTest] public async Task ReturnsCorrectCountOfDeploymentStatusesWithStart() { @@ -112,6 +156,28 @@ public class DeploymentStatusClientTests : IDisposable Assert.Equal(1, deploymentStatuses.Count); } + [IntegrationTest] + public async Task ReturnsCorrectCountOfDeploymentStatusesWithStartWithRepositoryId() + { + var newStatus1 = new NewDeploymentStatus(DeploymentState.Success); + var newStatus2 = new NewDeploymentStatus(DeploymentState.Success); + var newStatus3 = new NewDeploymentStatus(DeploymentState.Success); + await _deploymentsClient.Status.Create(_context.Repository.Id,_deployment.Id, newStatus1); + await _deploymentsClient.Status.Create(_context.Repository.Id, _deployment.Id, newStatus2); + await _deploymentsClient.Status.Create(_context.Repository.Id, _deployment.Id, newStatus3); + + var options = new ApiOptions + { + PageSize = 2, + PageCount = 1, + StartPage = 2 + }; + + var deploymentStatuses = await _deploymentsClient.Status.GetAll(_context.Repository.Id, _deployment.Id, options); + + Assert.Equal(1, deploymentStatuses.Count); + } + [IntegrationTest] public async Task ReturnsDistinctDeploymentStatusesBasedOnStartPage() { @@ -142,6 +208,36 @@ public class DeploymentStatusClientTests : IDisposable Assert.NotEqual(firstPage[0].Id, secondPage[0].Id); } + [IntegrationTest] + public async Task ReturnsDistinctDeploymentStatusesBasedOnStartPageWithRepositoryId() + { + var newStatus1 = new NewDeploymentStatus(DeploymentState.Success); + var newStatus2 = new NewDeploymentStatus(DeploymentState.Success); + var newStatus3 = new NewDeploymentStatus(DeploymentState.Success); + await _deploymentsClient.Status.Create(_context.Repository.Id, _deployment.Id, newStatus1); + await _deploymentsClient.Status.Create(_context.Repository.Id, _deployment.Id, newStatus2); + await _deploymentsClient.Status.Create(_context.Repository.Id, _deployment.Id, newStatus3); + + var startOptions = new ApiOptions + { + PageSize = 1, + PageCount = 1 + }; + + var firstPage = await _deploymentsClient.Status.GetAll(_context.Repository.Id, _deployment.Id, startOptions); + + var skipStartOptions = new ApiOptions + { + PageSize = 1, + PageCount = 1, + StartPage = 2 + }; + + var secondPage = await _deploymentsClient.Status.GetAll(_context.Repository.Id, _deployment.Id, skipStartOptions); + + Assert.NotEqual(firstPage[0].Id, secondPage[0].Id); + } + public void Dispose() { _context.Dispose(); From 6f34827817ef7da5181f43b6d67b2b481d71a821 Mon Sep 17 00:00:00 2001 From: "aedampir@gmail.com" Date: Wed, 29 Jun 2016 02:11:28 +0700 Subject: [PATCH 5/8] removed tags --- .../Clients/IObservableDeploymentStatusClient.cs | 6 ------ .../Clients/ObservableDeploymentStatusClient.cs | 6 ------ Octokit/Clients/DeploymentStatusClient.cs | 6 ------ Octokit/Clients/IDeploymentStatusClient.cs | 6 ------ 4 files changed, 24 deletions(-) diff --git a/Octokit.Reactive/Clients/IObservableDeploymentStatusClient.cs b/Octokit.Reactive/Clients/IObservableDeploymentStatusClient.cs index 7114e7df..2e799858 100644 --- a/Octokit.Reactive/Clients/IObservableDeploymentStatusClient.cs +++ b/Octokit.Reactive/Clients/IObservableDeploymentStatusClient.cs @@ -21,7 +21,6 @@ namespace Octokit.Reactive /// The owner of the repository. /// The name of the repository. /// The id of the deployment. - /// A of es for the given deployment. IObservable GetAll(string owner, string name, int deploymentId); /// @@ -33,7 +32,6 @@ namespace Octokit.Reactive /// /// The ID of the repository. /// The id of the deployment. - /// A of es for the given deployment. IObservable GetAll(int repositoryId, int deploymentId); /// @@ -47,7 +45,6 @@ namespace Octokit.Reactive /// The name of the repository. /// The id of the deployment. /// Options for changing the API response - /// A of es for the given deployment. IObservable GetAll(string owner, string name, int deploymentId, ApiOptions options); /// @@ -60,7 +57,6 @@ namespace Octokit.Reactive /// The ID of the repository. /// The id of the deployment. /// Options for changing the API response - /// A of es for the given deployment. IObservable GetAll(int repositoryId, int deploymentId, ApiOptions options); /// @@ -74,7 +70,6 @@ namespace Octokit.Reactive /// The name of the repository. /// The id of the deployment. /// The new deployment status to create. - /// A representing created deployment status. IObservable Create(string owner, string name, int deploymentId, NewDeploymentStatus newDeploymentStatus); /// @@ -87,7 +82,6 @@ namespace Octokit.Reactive /// The ID of the repository. /// The id of the deployment. /// The new deployment status to create. - /// A representing created deployment status. IObservable Create(int repositoryId, int deploymentId, NewDeploymentStatus newDeploymentStatus); } } diff --git a/Octokit.Reactive/Clients/ObservableDeploymentStatusClient.cs b/Octokit.Reactive/Clients/ObservableDeploymentStatusClient.cs index e94ca694..f982d64e 100644 --- a/Octokit.Reactive/Clients/ObservableDeploymentStatusClient.cs +++ b/Octokit.Reactive/Clients/ObservableDeploymentStatusClient.cs @@ -34,7 +34,6 @@ namespace Octokit.Reactive.Clients /// The owner of the repository. /// The name of the repository. /// The id of the deployment. - /// A of es for the given deployment. public IObservable GetAll(string owner, string name, int deploymentId) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -52,7 +51,6 @@ namespace Octokit.Reactive.Clients /// /// The ID of the repository. /// The id of the deployment. - /// A of es for the given deployment. public IObservable GetAll(int repositoryId, int deploymentId) { return GetAll(repositoryId, deploymentId, ApiOptions.None); @@ -69,7 +67,6 @@ namespace Octokit.Reactive.Clients /// The name of the repository. /// The id of the deployment. /// Options for changing the API response - /// A of es for the given deployment. public IObservable GetAll(string owner, string name, int deploymentId, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -90,7 +87,6 @@ namespace Octokit.Reactive.Clients /// The ID of the repository. /// The id of the deployment. /// Options for changing the API response - /// A of es for the given deployment. public IObservable GetAll(int repositoryId, int deploymentId, ApiOptions options) { Ensure.ArgumentNotNull(options, "options"); @@ -110,7 +106,6 @@ namespace Octokit.Reactive.Clients /// The name of the repository. /// The id of the deployment. /// The new deployment status to create. - /// A representing created deployment status. public IObservable Create(string owner, string name, int deploymentId, NewDeploymentStatus newDeploymentStatus) { Ensure.ArgumentNotNull(newDeploymentStatus, "newDeploymentStatus"); @@ -128,7 +123,6 @@ namespace Octokit.Reactive.Clients /// The ID of the repository. /// The id of the deployment. /// The new deployment status to create. - /// A representing created deployment status. public IObservable Create(int repositoryId, int deploymentId, NewDeploymentStatus newDeploymentStatus) { Ensure.ArgumentNotNull(newDeploymentStatus, "newDeploymentStatus"); diff --git a/Octokit/Clients/DeploymentStatusClient.cs b/Octokit/Clients/DeploymentStatusClient.cs index 16f9aa93..a87f766d 100644 --- a/Octokit/Clients/DeploymentStatusClient.cs +++ b/Octokit/Clients/DeploymentStatusClient.cs @@ -27,7 +27,6 @@ namespace Octokit /// The owner of the repository. /// The name of the repository. /// The id of the deployment. - /// A of es for the given deployment. public Task> GetAll(string owner, string name, int deploymentId) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -45,7 +44,6 @@ namespace Octokit /// /// The ID of the repository. /// The id of the deployment. - /// A of es for the given deployment. public Task> GetAll(int repositoryId, int deploymentId) { return GetAll(repositoryId, deploymentId, ApiOptions.None); @@ -62,7 +60,6 @@ namespace Octokit /// The name of the repository. /// The id of the deployment. /// Options for changing the API response - /// A of es for the given deployment. public Task> GetAll(string owner, string name, int deploymentId, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -85,7 +82,6 @@ namespace Octokit /// The ID of the repository. /// The id of the deployment. /// Options for changing the API response - /// A of es for the given deployment. public Task> GetAll(int repositoryId, int deploymentId, ApiOptions options) { Ensure.ArgumentNotNull(options, "options"); @@ -104,7 +100,6 @@ namespace Octokit /// The name of the repository. /// The id of the deployment. /// - /// A representing created deployment status. public Task Create(string owner, string name, int deploymentId, NewDeploymentStatus newDeploymentStatus) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -126,7 +121,6 @@ namespace Octokit /// The ID of the repository. /// The id of the deployment. /// - /// A representing created deployment status. public Task Create(int repositoryId, int deploymentId, NewDeploymentStatus newDeploymentStatus) { Ensure.ArgumentNotNull(newDeploymentStatus, "newDeploymentStatus"); diff --git a/Octokit/Clients/IDeploymentStatusClient.cs b/Octokit/Clients/IDeploymentStatusClient.cs index 89085698..fba2dea6 100644 --- a/Octokit/Clients/IDeploymentStatusClient.cs +++ b/Octokit/Clients/IDeploymentStatusClient.cs @@ -22,7 +22,6 @@ namespace Octokit /// The owner of the repository. /// The name of the repository. /// The id of the deployment. - /// A of es for the given deployment. Task> GetAll(string owner, string name, int deploymentId); /// @@ -34,7 +33,6 @@ namespace Octokit /// /// The ID of the repository. /// The id of the deployment. - /// A of es for the given deployment. Task> GetAll(int repositoryId, int deploymentId); /// @@ -48,7 +46,6 @@ namespace Octokit /// The name of the repository. /// The id of the deployment. /// Options for changing the API response - /// A of es for the given deployment. Task> GetAll(string owner, string name, int deploymentId, ApiOptions options); /// @@ -61,7 +58,6 @@ namespace Octokit /// The ID of the repository. /// The id of the deployment. /// Options for changing the API response - /// A of es for the given deployment. Task> GetAll(int repositoryId, int deploymentId, ApiOptions options); /// @@ -75,7 +71,6 @@ namespace Octokit /// The name of the repository. /// The id of the deployment. /// - /// A representing created deployment status. Task Create(string owner, string name, int deploymentId, NewDeploymentStatus newDeploymentStatus); /// @@ -88,7 +83,6 @@ namespace Octokit /// The ID of the repository. /// The id of the deployment. /// - /// A representing created deployment status. Task Create(int repositoryId, int deploymentId, NewDeploymentStatus newDeploymentStatus); } } \ No newline at end of file From 386fa17d789e0ba10d5afa43f45bb8c559822de2 Mon Sep 17 00:00:00 2001 From: "aedampir@gmail.com" Date: Wed, 29 Jun 2016 02:41:13 +0700 Subject: [PATCH 6/8] fixed errors in tests --- .../Clients/DeploymentStatusClientTests.cs | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/Octokit.Tests/Clients/DeploymentStatusClientTests.cs b/Octokit.Tests/Clients/DeploymentStatusClientTests.cs index ca84220d..958b4d5c 100644 --- a/Octokit.Tests/Clients/DeploymentStatusClientTests.cs +++ b/Octokit.Tests/Clients/DeploymentStatusClientTests.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.Threading.Tasks; using NSubstitute; using Octokit; @@ -169,20 +168,6 @@ public class DeploymentStatusClientTests await Assert.ThrowsAsync(() => client.Create("owner", whitespace, 1, newDeploymentStatus)); } - [Fact] - public void PostsToCorrectUrl() - { - var connection = Substitute.For(); - var client = new DeploymentStatusClient(connection); - var expectedUrl = "repos/owner/repo/deployments/1/statuses"; - - client.Create("owner", "repo", 1, newDeploymentStatus); - - connection.Received().Post(Arg.Is(u => u.ToString() == expectedUrl), - Arg.Any(), - Arg.Any()); - } - [Fact] public void PassesNewDeploymentRequest() { From e094de3e58730374b784664bd8cac4922359480f Mon Sep 17 00:00:00 2001 From: "aedampir@gmail.com" Date: Wed, 29 Jun 2016 04:11:01 +0700 Subject: [PATCH 7/8] fixed some errors in tests --- .../Clients/DeploymentStatusClientTests.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Octokit.Tests/Clients/DeploymentStatusClientTests.cs b/Octokit.Tests/Clients/DeploymentStatusClientTests.cs index 958b4d5c..fc1e7e65 100644 --- a/Octokit.Tests/Clients/DeploymentStatusClientTests.cs +++ b/Octokit.Tests/Clients/DeploymentStatusClientTests.cs @@ -18,7 +18,11 @@ public class DeploymentStatusClientTests await client.GetAll("owner", "name", 1); - connection.Received().GetAll(Arg.Is(u => u.ToString() == expectedUrl), Args.ApiOptions); + connection.Received().GetAll< + DeploymentStatus>(Arg.Is(u => u.ToString() == expectedUrl), + null, + "application/vnd.github.ant-man-preview+json", + Args.ApiOptions); } [Fact] @@ -49,7 +53,11 @@ public class DeploymentStatusClientTests await client.GetAll("owner", "name", 1, options); - connection.Received().GetAll(Arg.Is(u => u.ToString() == expectedUrl), options); + connection.Received().GetAll( + Arg.Is(u => u.ToString() == expectedUrl), + null, + "application/vnd.github.ant-man-preview+json", + options); } [Fact] @@ -123,7 +131,8 @@ public class DeploymentStatusClientTests client.Create("owner", "repo", 1, newDeploymentStatus); connection.Received().Post(Arg.Is(u => u.ToString() == expectedUrl), - Arg.Any()); + newDeploymentStatus, + "application/vnd.github.ant-man-preview+json"); } [Fact] From 5ab95230447d3821752f5987be2017ef0e94f395 Mon Sep 17 00:00:00 2001 From: "aedampir@gmail.com" Date: Wed, 6 Jul 2016 02:48:09 +0700 Subject: [PATCH 8/8] fixed some docs adden null checks --- Octokit.Reactive/Clients/ObservableDeploymentStatusClient.cs | 2 ++ Octokit/Clients/DeploymentStatusClient.cs | 4 ++-- Octokit/Clients/IDeploymentStatusClient.cs | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Octokit.Reactive/Clients/ObservableDeploymentStatusClient.cs b/Octokit.Reactive/Clients/ObservableDeploymentStatusClient.cs index f982d64e..eb8b4af0 100644 --- a/Octokit.Reactive/Clients/ObservableDeploymentStatusClient.cs +++ b/Octokit.Reactive/Clients/ObservableDeploymentStatusClient.cs @@ -108,6 +108,8 @@ namespace Octokit.Reactive.Clients /// The new deployment status to create. public IObservable Create(string owner, string name, int deploymentId, NewDeploymentStatus newDeploymentStatus) { + Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); + Ensure.ArgumentNotNullOrEmptyString(name, "name"); Ensure.ArgumentNotNull(newDeploymentStatus, "newDeploymentStatus"); return _client.Create(owner, name, deploymentId, newDeploymentStatus).ToObservable(); diff --git a/Octokit/Clients/DeploymentStatusClient.cs b/Octokit/Clients/DeploymentStatusClient.cs index a87f766d..858515b8 100644 --- a/Octokit/Clients/DeploymentStatusClient.cs +++ b/Octokit/Clients/DeploymentStatusClient.cs @@ -99,7 +99,7 @@ namespace Octokit /// The owner of the repository. /// The name of the repository. /// The id of the deployment. - /// + /// The new deployment status to create. public Task Create(string owner, string name, int deploymentId, NewDeploymentStatus newDeploymentStatus) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -120,7 +120,7 @@ namespace Octokit /// /// The ID of the repository. /// The id of the deployment. - /// + /// The new deployment status to create. public Task Create(int repositoryId, int deploymentId, NewDeploymentStatus newDeploymentStatus) { Ensure.ArgumentNotNull(newDeploymentStatus, "newDeploymentStatus"); diff --git a/Octokit/Clients/IDeploymentStatusClient.cs b/Octokit/Clients/IDeploymentStatusClient.cs index fba2dea6..57a879ab 100644 --- a/Octokit/Clients/IDeploymentStatusClient.cs +++ b/Octokit/Clients/IDeploymentStatusClient.cs @@ -70,7 +70,7 @@ namespace Octokit /// The owner of the repository. /// The name of the repository. /// The id of the deployment. - /// + /// The new deployment status to create. Task Create(string owner, string name, int deploymentId, NewDeploymentStatus newDeploymentStatus); /// @@ -82,7 +82,7 @@ namespace Octokit /// /// The ID of the repository. /// The id of the deployment. - /// + /// The new deployment status to create. Task Create(int repositoryId, int deploymentId, NewDeploymentStatus newDeploymentStatus); } } \ No newline at end of file