From 54cdb972a96bb430db30cca8bfe2ac3521a6cd52 Mon Sep 17 00:00:00 2001 From: Kristian Hellang Date: Sun, 1 Dec 2013 22:00:11 +0100 Subject: [PATCH] Added stubs for IGistCommentsClient --- Octokit.Tests/Clients/GistsClientTests.cs | 8 +++++ Octokit/Clients/GistCommentsClient.cs | 41 +++++++++++++++++++++++ Octokit/Clients/GistsClient.cs | 3 ++ Octokit/Clients/IGistCommentsClient.cs | 17 ++++++++++ Octokit/Clients/IGistsClient.cs | 2 ++ Octokit/Models/Response/GistComment.cs | 7 ++++ Octokit/Octokit-Mono.csproj | 3 ++ Octokit/Octokit-MonoAndroid.csproj | 3 ++ Octokit/Octokit-Monotouch.csproj | 3 ++ Octokit/Octokit-netcore45.csproj | 3 ++ Octokit/Octokit.csproj | 3 ++ 11 files changed, 93 insertions(+) create mode 100644 Octokit/Clients/GistCommentsClient.cs create mode 100644 Octokit/Clients/IGistCommentsClient.cs create mode 100644 Octokit/Models/Response/GistComment.cs diff --git a/Octokit.Tests/Clients/GistsClientTests.cs b/Octokit.Tests/Clients/GistsClientTests.cs index f83742cf..ad3f6d76 100644 --- a/Octokit.Tests/Clients/GistsClientTests.cs +++ b/Octokit.Tests/Clients/GistsClientTests.cs @@ -26,5 +26,13 @@ public class GistsClientTests { Assert.Throws(() => new GistsClient(null)); } + + [Fact] + public void SetCommentsClient() + { + var apiConnection = Substitute.For(); + var client = new GistsClient(apiConnection); + Assert.NotNull(client.Comment); + } } } diff --git a/Octokit/Clients/GistCommentsClient.cs b/Octokit/Clients/GistCommentsClient.cs new file mode 100644 index 00000000..e204ba8e --- /dev/null +++ b/Octokit/Clients/GistCommentsClient.cs @@ -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 Get(int gistId, int commentId) + { + throw new System.NotImplementedException(); + } + + public Task> GetForGist(int gistId) + { + throw new System.NotImplementedException(); + } + + public Task Create(int gistId, string comment) + { + Ensure.ArgumentNotNullOrEmptyString(comment, "comment"); + + throw new System.NotImplementedException(); + } + + public Task 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(); + } + } +} \ No newline at end of file diff --git a/Octokit/Clients/GistsClient.cs b/Octokit/Clients/GistsClient.cs index c2897f59..0a08b80f 100644 --- a/Octokit/Clients/GistsClient.cs +++ b/Octokit/Clients/GistsClient.cs @@ -7,8 +7,11 @@ namespace Octokit public GistsClient(IApiConnection apiConnection) : base(apiConnection) { + Comment = new GistCommentsClient(apiConnection); } + public IGistCommentsClient Comment { get; set; } + /// /// Gets a gist /// diff --git a/Octokit/Clients/IGistCommentsClient.cs b/Octokit/Clients/IGistCommentsClient.cs new file mode 100644 index 00000000..554a1bc3 --- /dev/null +++ b/Octokit/Clients/IGistCommentsClient.cs @@ -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 Get(int gistId, int commentId); + Task> GetForGist(int gistId); + Task Create(int gistId, string comment); + Task Update(int gistId, int commentId, string comment); + Task Delete(int gistId, int commentId); + } +} diff --git a/Octokit/Clients/IGistsClient.cs b/Octokit/Clients/IGistsClient.cs index 93a44d50..a8a90fdb 100644 --- a/Octokit/Clients/IGistsClient.cs +++ b/Octokit/Clients/IGistsClient.cs @@ -5,6 +5,8 @@ namespace Octokit { public interface IGistsClient { + IGistCommentsClient Comment { get; set; } + /// /// Gets a gist /// diff --git a/Octokit/Models/Response/GistComment.cs b/Octokit/Models/Response/GistComment.cs new file mode 100644 index 00000000..6ad48f3d --- /dev/null +++ b/Octokit/Models/Response/GistComment.cs @@ -0,0 +1,7 @@ +namespace Octokit +{ + public class GistComment + { + + } +} \ No newline at end of file diff --git a/Octokit/Octokit-Mono.csproj b/Octokit/Octokit-Mono.csproj index 3eec02af..b4f5a9e2 100644 --- a/Octokit/Octokit-Mono.csproj +++ b/Octokit/Octokit-Mono.csproj @@ -229,6 +229,9 @@ + + + \ No newline at end of file diff --git a/Octokit/Octokit-MonoAndroid.csproj b/Octokit/Octokit-MonoAndroid.csproj index 4e32d67f..f422fadc 100644 --- a/Octokit/Octokit-MonoAndroid.csproj +++ b/Octokit/Octokit-MonoAndroid.csproj @@ -239,6 +239,9 @@ + + + \ No newline at end of file diff --git a/Octokit/Octokit-Monotouch.csproj b/Octokit/Octokit-Monotouch.csproj index 0704707f..01144c1a 100644 --- a/Octokit/Octokit-Monotouch.csproj +++ b/Octokit/Octokit-Monotouch.csproj @@ -234,6 +234,9 @@ + + + \ No newline at end of file diff --git a/Octokit/Octokit-netcore45.csproj b/Octokit/Octokit-netcore45.csproj index 1e911000..6a66cba1 100644 --- a/Octokit/Octokit-netcore45.csproj +++ b/Octokit/Octokit-netcore45.csproj @@ -227,6 +227,9 @@ + + + diff --git a/Octokit/Octokit.csproj b/Octokit/Octokit.csproj index 229f056d..8eb92c0e 100644 --- a/Octokit/Octokit.csproj +++ b/Octokit/Octokit.csproj @@ -53,7 +53,9 @@ Properties\SolutionInfo.cs + + @@ -72,6 +74,7 @@ +