mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-06 07:16:09 +00:00
Added stubs for IGistCommentsClient
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
41
Octokit/Clients/GistCommentsClient.cs
Normal file
41
Octokit/Clients/GistCommentsClient.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
|
||||
17
Octokit/Clients/IGistCommentsClient.cs
Normal file
17
Octokit/Clients/IGistCommentsClient.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,8 @@ namespace Octokit
|
||||
{
|
||||
public interface IGistsClient
|
||||
{
|
||||
IGistCommentsClient Comment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a gist
|
||||
/// </summary>
|
||||
|
||||
7
Octokit/Models/Response/GistComment.cs
Normal file
7
Octokit/Models/Response/GistComment.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace Octokit
|
||||
{
|
||||
public class GistComment
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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">
|
||||
|
||||
@@ -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" />
|
||||
|
||||
Reference in New Issue
Block a user