Added stubs for IGistCommentsClient

This commit is contained in:
Kristian Hellang
2013-12-01 22:00:11 +01:00
parent 066b2e6198
commit 54cdb972a9
11 changed files with 93 additions and 0 deletions

View File

@@ -26,5 +26,13 @@ public class GistsClientTests
{
Assert.Throws<ArgumentNullException>(() => new GistsClient(null));
}
[Fact]
public void SetCommentsClient()
{
var apiConnection = Substitute.For<IApiConnection>();
var client = new GistsClient(apiConnection);
Assert.NotNull(client.Comment);
}
}
}

View File

@@ -0,0 +1,41 @@
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Octokit
{
public class GistCommentsClient : ApiClient, IGistCommentsClient
{
public GistCommentsClient(IApiConnection apiConnection) : base(apiConnection)
{
}
public Task<GistComment> Get(int gistId, int commentId)
{
throw new System.NotImplementedException();
}
public Task<IReadOnlyList<GistComment>> GetForGist(int gistId)
{
throw new System.NotImplementedException();
}
public Task<GistComment> Create(int gistId, string comment)
{
Ensure.ArgumentNotNullOrEmptyString(comment, "comment");
throw new System.NotImplementedException();
}
public Task<GistComment> Update(int gistId, int commentId, string comment)
{
Ensure.ArgumentNotNullOrEmptyString(comment, "comment");
throw new System.NotImplementedException();
}
public Task Delete(int gistId, int commentId)
{
throw new System.NotImplementedException();
}
}
}

View File

@@ -7,8 +7,11 @@ namespace Octokit
public GistsClient(IApiConnection apiConnection) :
base(apiConnection)
{
Comment = new GistCommentsClient(apiConnection);
}
public IGistCommentsClient Comment { get; set; }
/// <summary>
/// Gets a gist
/// </summary>

View File

@@ -0,0 +1,17 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
namespace Octokit
{
public interface IGistCommentsClient
{
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get",
Justification = "Method makes a network request")]
Task<GistComment> Get(int gistId, int commentId);
Task<IReadOnlyList<GistComment>> GetForGist(int gistId);
Task<GistComment> Create(int gistId, string comment);
Task<GistComment> Update(int gistId, int commentId, string comment);
Task Delete(int gistId, int commentId);
}
}

View File

@@ -5,6 +5,8 @@ namespace Octokit
{
public interface IGistsClient
{
IGistCommentsClient Comment { get; set; }
/// <summary>
/// Gets a gist
/// </summary>

View File

@@ -0,0 +1,7 @@
namespace Octokit
{
public class GistComment
{
}
}

View File

@@ -229,6 +229,9 @@
<Compile Include="Models\Response\BlobReference.cs" />
<Compile Include="Clients\RepoCollaboratorsClient.cs" />
<Compile Include="Clients\IRepoCollaboratorsClient.cs" />
<Compile Include="Clients\GistCommentsClient.cs" />
<Compile Include="Clients\IGistCommentsClient.cs" />
<Compile Include="Models\Response\GistComment.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -239,6 +239,9 @@
<Compile Include="Models\Request\NewReference.cs" />
<Compile Include="Models\Request\ReferenceUpdate.cs" />
<Compile Include="Models\Response\Reference.cs" />
<Compile Include="Clients\GistCommentsClient.cs" />
<Compile Include="Clients\IGistCommentsClient.cs" />
<Compile Include="Models\Response\GistComment.cs" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Novell\Novell.MonoDroid.CSharp.targets" />
</Project>

View File

@@ -234,6 +234,9 @@
<Compile Include="Models\Request\NewReference.cs" />
<Compile Include="Models\Request\ReferenceUpdate.cs" />
<Compile Include="Models\Response\Reference.cs" />
<Compile Include="Clients\GistCommentsClient.cs" />
<Compile Include="Clients\IGistCommentsClient.cs" />
<Compile Include="Models\Response\GistComment.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -227,6 +227,9 @@
<Compile Include="Models\Response\BlobReference.cs" />
<Compile Include="Clients\RepoCollaboratorsClient.cs" />
<Compile Include="Clients\IRepoCollaboratorsClient.cs" />
<Compile Include="Clients\GistCommentsClient.cs" />
<Compile Include="Clients\IGistCommentsClient.cs" />
<Compile Include="Models\Response\GistComment.cs" />
</ItemGroup>
<ItemGroup>
<CodeAnalysisDictionary Include="..\CustomDictionary.xml">

View File

@@ -53,7 +53,9 @@
<Link>Properties\SolutionInfo.cs</Link>
</Compile>
<Compile Include="Clients\ActivitiesClient.cs" />
<Compile Include="Clients\GistCommentsClient.cs" />
<Compile Include="Clients\GistsClient.cs" />
<Compile Include="Clients\IGistCommentsClient.cs" />
<Compile Include="Clients\IGistsClient.cs" />
<Compile Include="Clients\IReferencesClient.cs" />
<Compile Include="Clients\ReferencesClient.cs" />
@@ -72,6 +74,7 @@
<Compile Include="Models\Request\NewTreeItem.cs" />
<Compile Include="Models\Request\NewTree.cs" />
<Compile Include="Clients\TreesClient.cs" />
<Compile Include="Models\Response\GistComment.cs" />
<Compile Include="Models\Response\Reference.cs" />
<Compile Include="Models\Response\TreeItem.cs" />
<Compile Include="Models\Response\TreeResponse.cs" />