Implemented DeploymentStatusesClient and unit tests

This commit is contained in:
pmacnaughton
2014-01-10 15:28:37 -07:00
parent c8d99c30f4
commit 3c5e39cc25
14 changed files with 270 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Octokit
{
public class DeploymentStatusClient : ApiClient, IDeploymentStatusClient
{
const string acceptsHeader = "application/vnd.github.cannonball-preview+json";
public DeploymentStatusClient(IApiConnection apiConnection)
: base(apiConnection)
{
}
public Task<IReadOnlyList<DeploymentStatus>> GetAll(string owner, string name, int deploymentId)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
return ApiConnection.GetAll<DeploymentStatus>(ApiUrls.DeploymentStatuses(owner, name, deploymentId),
null, acceptsHeader);
}
public Task<DeploymentStatus> Create(string owner, string name, int deploymentId, NewDeploymentStatus newDeploymentStatus)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
Ensure.ArgumentNotNull(newDeploymentStatus, "newDeploymentStatus");
return ApiConnection.Post<DeploymentStatus>(ApiUrls.DeploymentStatuses(owner, name, deploymentId),
newDeploymentStatus, acceptsHeader);
}
}
}