From 7bcfe3d0a157365d13163728d80b0da60a33d854 Mon Sep 17 00:00:00 2001 From: Alexander Efremov Date: Mon, 13 Jun 2016 00:47:03 +0700 Subject: [PATCH 1/8] modified XML docs --- Octokit.Reactive/Clients/IObservableStatisticsClient.cs | 6 ++++++ Octokit.Reactive/Clients/ObservableStatisticsClient.cs | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/Octokit.Reactive/Clients/IObservableStatisticsClient.cs b/Octokit.Reactive/Clients/IObservableStatisticsClient.cs index 5bb9a8bc..2c592efa 100644 --- a/Octokit.Reactive/Clients/IObservableStatisticsClient.cs +++ b/Octokit.Reactive/Clients/IObservableStatisticsClient.cs @@ -3,6 +3,12 @@ using System.Collections.Generic; namespace Octokit.Reactive { + /// + /// A client for GitHub's Repository Statistics API. + /// + /// + /// See the Repository Statistics API documentation for more information. + /// public interface IObservableStatisticsClient { /// diff --git a/Octokit.Reactive/Clients/ObservableStatisticsClient.cs b/Octokit.Reactive/Clients/ObservableStatisticsClient.cs index 74acaa64..c4b993b8 100644 --- a/Octokit.Reactive/Clients/ObservableStatisticsClient.cs +++ b/Octokit.Reactive/Clients/ObservableStatisticsClient.cs @@ -4,6 +4,12 @@ using System.Reactive.Threading.Tasks; namespace Octokit.Reactive { + /// + /// A client for GitHub's Repository Statistics API. + /// + /// + /// See the Repository Statistics API documentation for more information. + /// public class ObservableStatisticsClient : IObservableStatisticsClient { readonly IGitHubClient _client; From 9d012f5e1d8a3c223763e497f0cf49d6491c6ca6 Mon Sep 17 00:00:00 2001 From: Alexander Efremov Date: Mon, 13 Jun 2016 00:55:27 +0700 Subject: [PATCH 2/8] renamed repositoryName to name --- .../Clients/IObservableStatisticsClient.cs | 20 +++--- .../Clients/ObservableStatisticsClient.cs | 40 +++++------ Octokit/Clients/IStatisticsClient.cs | 40 +++++------ Octokit/Clients/StatisticsClient.cs | 70 +++++++++---------- 4 files changed, 85 insertions(+), 85 deletions(-) diff --git a/Octokit.Reactive/Clients/IObservableStatisticsClient.cs b/Octokit.Reactive/Clients/IObservableStatisticsClient.cs index 2c592efa..7261b3d1 100644 --- a/Octokit.Reactive/Clients/IObservableStatisticsClient.cs +++ b/Octokit.Reactive/Clients/IObservableStatisticsClient.cs @@ -15,40 +15,40 @@ namespace Octokit.Reactive /// Returns a list of for the given repository /// /// The owner of the repository - /// The name of the repository + /// The name of the repository /// A list of - IObservable> GetContributors(string owner, string repositoryName); + IObservable> GetContributors(string owner, string name); /// /// Returns the last year of commit activity grouped by week. /// /// The owner of the repository - /// The name of the repository + /// The name of the repository /// The last year of - IObservable GetCommitActivity(string owner, string repositoryName); + IObservable GetCommitActivity(string owner, string name); /// /// Returns a weekly aggregate of the number of additions and deletions pushed to a repository. /// /// The owner of the repository - /// The name of the repository + /// The name of the repository /// Returns a weekly aggregate of the number additions and deletion - IObservable GetCodeFrequency(string owner, string repositoryName); + IObservable GetCodeFrequency(string owner, string name); /// /// Returns the total commit counts for the owner and total commit counts in total. /// /// The owner of the repository - /// The name of the repository + /// The name of the repository /// Returns from oldest week to now - IObservable GetParticipation(string owner, string repositoryName); + IObservable GetParticipation(string owner, string name); /// /// Returns a list of the number of commits per hour in each day /// /// The owner of the repository - /// The name of the repository + /// The name of the repository /// Returns commit counts per hour in each day - IObservable GetPunchCard(string owner, string repositoryName); + IObservable GetPunchCard(string owner, string name); } } \ No newline at end of file diff --git a/Octokit.Reactive/Clients/ObservableStatisticsClient.cs b/Octokit.Reactive/Clients/ObservableStatisticsClient.cs index c4b993b8..16a67d9d 100644 --- a/Octokit.Reactive/Clients/ObservableStatisticsClient.cs +++ b/Octokit.Reactive/Clients/ObservableStatisticsClient.cs @@ -24,70 +24,70 @@ namespace Octokit.Reactive /// Returns a list of for the given repository /// /// The owner of the repository - /// The name of the repository + /// The name of the repository /// A list of - public IObservable> GetContributors(string owner, string repositoryName) + public IObservable> GetContributors(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName"); + Ensure.ArgumentNotNullOrEmptyString(name, "name"); - return _client.Repository.Statistics.GetContributors(owner, repositoryName).ToObservable(); + return _client.Repository.Statistics.GetContributors(owner, name).ToObservable(); } /// /// Returns the last year of commit activity grouped by week. /// /// The owner of the repository - /// The name of the repository + /// The name of the repository /// The last year of - public IObservable GetCommitActivity(string owner, string repositoryName) + public IObservable GetCommitActivity(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName"); + Ensure.ArgumentNotNullOrEmptyString(name, "name"); - return _client.Repository.Statistics.GetCommitActivity(owner, repositoryName).ToObservable(); + return _client.Repository.Statistics.GetCommitActivity(owner, name).ToObservable(); } /// /// Returns a weekly aggregate of the number of additions and deletions pushed to a repository. /// /// The owner of the repository - /// The name of the repository + /// The name of the repository /// Returns a weekly aggregate of the number additions and deletion - public IObservable GetCodeFrequency(string owner, string repositoryName) + public IObservable GetCodeFrequency(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName"); + Ensure.ArgumentNotNullOrEmptyString(name, "name"); - return _client.Repository.Statistics.GetCodeFrequency(owner, repositoryName).ToObservable(); + return _client.Repository.Statistics.GetCodeFrequency(owner, name).ToObservable(); } /// /// Returns the total commit counts for the owner and total commit counts in total. /// /// The owner of the repository - /// The name of the repository + /// The name of the repository /// Returns from oldest week to now - public IObservable GetParticipation(string owner, string repositoryName) + public IObservable GetParticipation(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName"); + Ensure.ArgumentNotNullOrEmptyString(name, "name"); - return _client.Repository.Statistics.GetParticipation(owner, repositoryName).ToObservable(); + return _client.Repository.Statistics.GetParticipation(owner, name).ToObservable(); } /// /// Returns a list of the number of commits per hour in each day /// /// The owner of the repository - /// The name of the repository + /// The name of the repository /// Returns commit counts per hour in each day - public IObservable GetPunchCard(string owner, string repositoryName) + public IObservable GetPunchCard(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName"); + Ensure.ArgumentNotNullOrEmptyString(name, "name"); - return _client.Repository.Statistics.GetPunchCard(owner, repositoryName).ToObservable(); + return _client.Repository.Statistics.GetPunchCard(owner, name).ToObservable(); } } } \ No newline at end of file diff --git a/Octokit/Clients/IStatisticsClient.cs b/Octokit/Clients/IStatisticsClient.cs index ff97aca9..da06d2a5 100644 --- a/Octokit/Clients/IStatisticsClient.cs +++ b/Octokit/Clients/IStatisticsClient.cs @@ -16,85 +16,85 @@ namespace Octokit /// Returns a list of for the given repository /// /// The owner of the repository - /// The name of the repository + /// The name of the repository /// A list of - Task> GetContributors(string owner, string repositoryName); + Task> GetContributors(string owner, string name); /// /// Returns a list of for the given repository /// /// The owner of the repository - /// The name of the repository + /// The name of the repository /// A token used to cancel this potentially long running request /// A list of - Task> GetContributors(string owner, string repositoryName, CancellationToken cancellationToken); + Task> GetContributors(string owner, string name, CancellationToken cancellationToken); /// /// Returns the last year of commit activity grouped by week. /// /// The owner of the repository - /// The name of the repository + /// The name of the repository /// The last year of - Task GetCommitActivity(string owner, string repositoryName); + Task GetCommitActivity(string owner, string name); /// /// Returns the last year of commit activity grouped by week. /// /// The owner of the repository - /// The name of the repository + /// The name of the repository /// A token used to cancel this potentially long running request /// The last year of - Task GetCommitActivity(string owner, string repositoryName, CancellationToken cancellationToken); + Task GetCommitActivity(string owner, string name, CancellationToken cancellationToken); /// /// Returns a weekly aggregate of the number of additions and deletions pushed to a repository. /// /// The owner of the repository - /// The name of the repository + /// The name of the repository /// Returns a weekly aggregate of the number additions and deletion - Task GetCodeFrequency(string owner, string repositoryName); + Task GetCodeFrequency(string owner, string name); /// /// Returns a weekly aggregate of the number of additions and deletions pushed to a repository. /// /// The owner of the repository - /// The name of the repository + /// The name of the repository /// A token used to cancel this potentially long running request /// Returns a weekly aggregate of the number additions and deletion - Task GetCodeFrequency(string owner, string repositoryName, CancellationToken cancellationToken); + Task GetCodeFrequency(string owner, string name, CancellationToken cancellationToken); /// /// Returns the total commit counts for the owner and total commit counts in total. /// /// The owner of the repository - /// The name of the repository + /// The name of the repository /// Returns from oldest week to now - Task GetParticipation(string owner, string repositoryName); + Task GetParticipation(string owner, string name); /// /// Returns the total commit counts for the owner and total commit counts in total. /// /// The owner of the repository - /// The name of the repository + /// The name of the repository /// A token used to cancel this potentially long running request /// Returns from oldest week to now - Task GetParticipation(string owner, string repositoryName, CancellationToken cancellationToken); + Task GetParticipation(string owner, string name, CancellationToken cancellationToken); /// /// Returns a list of the number of commits per hour in each day /// /// The owner of the repository - /// The name of the repository + /// The name of the repository /// Returns commit counts per hour in each day - Task GetPunchCard(string owner, string repositoryName); + Task GetPunchCard(string owner, string name); /// /// Returns a list of the number of commits per hour in each day /// /// The owner of the repository - /// The name of the repository + /// The name of the repository /// A token used to cancel this potentially long running request /// Returns commit counts per hour in each day - Task GetPunchCard(string owner, string repositoryName, CancellationToken cancellationToken); + Task GetPunchCard(string owner, string name, CancellationToken cancellationToken); } } \ No newline at end of file diff --git a/Octokit/Clients/StatisticsClient.cs b/Octokit/Clients/StatisticsClient.cs index e8bc929e..34aef9c8 100644 --- a/Octokit/Clients/StatisticsClient.cs +++ b/Octokit/Clients/StatisticsClient.cs @@ -25,53 +25,53 @@ namespace Octokit /// Returns a list of for the given repository /// /// The owner of the repository - /// The name of the repository + /// The name of the repository /// A list of - public Task> GetContributors(string owner, string repositoryName) + public Task> GetContributors(string owner, string name) { - return GetContributors(owner, repositoryName, CancellationToken.None); + return GetContributors(owner, name, CancellationToken.None); } /// /// Returns a list of for the given repository /// /// The owner of the repository - /// The name of the repository + /// The name of the repository /// A token used to cancel this potentially long running request /// A list of - public Task> GetContributors(string owner, string repositoryName, CancellationToken cancellationToken) + public Task> GetContributors(string owner, string name, CancellationToken cancellationToken) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName"); + Ensure.ArgumentNotNullOrEmptyString(name, "name"); - return ApiConnection.GetQueuedOperation(ApiUrls.StatsContributors(owner, repositoryName), cancellationToken); + return ApiConnection.GetQueuedOperation(ApiUrls.StatsContributors(owner, name), cancellationToken); } /// /// Returns the last year of commit activity grouped by week. /// /// The owner of the repository - /// The name of the repository + /// The name of the repository /// The last year of - public Task GetCommitActivity(string owner, string repositoryName) + public Task GetCommitActivity(string owner, string name) { - return GetCommitActivity(owner, repositoryName, CancellationToken.None); + return GetCommitActivity(owner, name, CancellationToken.None); } /// /// Returns the last year of commit activity grouped by week. /// /// The owner of the repository - /// The name of the repository + /// The name of the repository /// A token used to cancel this potentially long running request /// The last year of - public async Task GetCommitActivity(string owner, string repositoryName, CancellationToken cancellationToken) + public async Task GetCommitActivity(string owner, string name, CancellationToken cancellationToken) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName"); + Ensure.ArgumentNotNullOrEmptyString(name, "name"); var activity = await ApiConnection.GetQueuedOperation( - ApiUrls.StatsCommitActivity(owner, repositoryName), cancellationToken).ConfigureAwait(false); + ApiUrls.StatsCommitActivity(owner, name), cancellationToken).ConfigureAwait(false); return new CommitActivity(activity); } @@ -79,27 +79,27 @@ namespace Octokit /// Returns a weekly aggregate of the number of additions and deletions pushed to a repository. /// /// The owner of the repository - /// The name of the repository + /// The name of the repository /// Returns a weekly aggregate of the number additions and deletion - public Task GetCodeFrequency(string owner, string repositoryName) + public Task GetCodeFrequency(string owner, string name) { - return GetCodeFrequency(owner, repositoryName, CancellationToken.None); + return GetCodeFrequency(owner, name, CancellationToken.None); } /// /// Returns a weekly aggregate of the number of additions and deletions pushed to a repository. /// /// The owner of the repository - /// The name of the repository + /// The name of the repository /// A token used to cancel this potentially long running request /// Returns a weekly aggregate of the number additions and deletion - public async Task GetCodeFrequency(string owner, string repositoryName, CancellationToken cancellationToken) + public async Task GetCodeFrequency(string owner, string name, CancellationToken cancellationToken) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName"); + Ensure.ArgumentNotNullOrEmptyString(name, "name"); var rawFrequencies = await ApiConnection.GetQueuedOperation( - ApiUrls.StatsCodeFrequency(owner, repositoryName), cancellationToken).ConfigureAwait(false); + ApiUrls.StatsCodeFrequency(owner, name), cancellationToken).ConfigureAwait(false); return new CodeFrequency(rawFrequencies); } @@ -107,27 +107,27 @@ namespace Octokit /// Returns the total commit counts for the owner and total commit counts in total. /// /// The owner of the repository - /// The name of the repository + /// The name of the repository /// Returns from oldest week to now - public Task GetParticipation(string owner, string repositoryName) + public Task GetParticipation(string owner, string name) { - return GetParticipation(owner, repositoryName, CancellationToken.None); + return GetParticipation(owner, name, CancellationToken.None); } /// /// Returns the total commit counts for the owner and total commit counts in total. /// /// The owner of the repository - /// The name of the repository + /// The name of the repository /// A token used to cancel this potentially long running request /// Returns from oldest week to now - public async Task GetParticipation(string owner, string repositoryName, CancellationToken cancellationToken) + public async Task GetParticipation(string owner, string name, CancellationToken cancellationToken) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName"); + Ensure.ArgumentNotNullOrEmptyString(name, "name"); var result = await ApiConnection.GetQueuedOperation( - ApiUrls.StatsParticipation(owner, repositoryName), cancellationToken).ConfigureAwait(false); + ApiUrls.StatsParticipation(owner, name), cancellationToken).ConfigureAwait(false); return result.FirstOrDefault(); } @@ -135,27 +135,27 @@ namespace Octokit /// Returns a list of the number of commits per hour in each day /// /// The owner of the repository - /// The name of the repository + /// The name of the repository /// Returns commit counts per hour in each day - public Task GetPunchCard(string owner, string repositoryName) + public Task GetPunchCard(string owner, string name) { - return GetPunchCard(owner, repositoryName, CancellationToken.None); + return GetPunchCard(owner, name, CancellationToken.None); } /// /// Returns a list of the number of commits per hour in each day /// /// The owner of the repository - /// The name of the repository + /// The name of the repository /// A token used to cancel this potentially long running request /// Returns commit counts per hour in each day - public async Task GetPunchCard(string owner, string repositoryName, CancellationToken cancellationToken) + public async Task GetPunchCard(string owner, string name, CancellationToken cancellationToken) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName"); + Ensure.ArgumentNotNullOrEmptyString(name, "name"); var punchCardData = await ApiConnection.GetQueuedOperation( - ApiUrls.StatsPunchCard(owner, repositoryName), cancellationToken).ConfigureAwait(false); + ApiUrls.StatsPunchCard(owner, name), cancellationToken).ConfigureAwait(false); return new PunchCard(punchCardData); } } From dcac7b9305c8ae7827a3b3b57a6fd99a2bd4f960 Mon Sep 17 00:00:00 2001 From: Alexander Efremov Date: Mon, 13 Jun 2016 12:05:05 +0700 Subject: [PATCH 3/8] added new overloads --- .../Clients/IObservableStatisticsClient.cs | 35 +++++ .../Clients/ObservableStatisticsClient.cs | 53 +++++++- Octokit/Clients/IStatisticsClient.cs | 75 ++++++++++ Octokit/Clients/StatisticsClient.cs | 128 ++++++++++++++++++ 4 files changed, 290 insertions(+), 1 deletion(-) diff --git a/Octokit.Reactive/Clients/IObservableStatisticsClient.cs b/Octokit.Reactive/Clients/IObservableStatisticsClient.cs index 7261b3d1..ec81cf82 100644 --- a/Octokit.Reactive/Clients/IObservableStatisticsClient.cs +++ b/Octokit.Reactive/Clients/IObservableStatisticsClient.cs @@ -19,6 +19,13 @@ namespace Octokit.Reactive /// A list of IObservable> GetContributors(string owner, string name); + /// + /// Returns a list of for the given repository + /// + /// The ID of the repository + /// A list of + IObservable> GetContributors(int repositoryId); + /// /// Returns the last year of commit activity grouped by week. /// @@ -27,6 +34,13 @@ namespace Octokit.Reactive /// The last year of IObservable GetCommitActivity(string owner, string name); + /// + /// Returns the last year of commit activity grouped by week. + /// + /// The ID of the repository + /// The last year of + IObservable GetCommitActivity(int repositoryId); + /// /// Returns a weekly aggregate of the number of additions and deletions pushed to a repository. /// @@ -35,6 +49,13 @@ namespace Octokit.Reactive /// Returns a weekly aggregate of the number additions and deletion IObservable GetCodeFrequency(string owner, string name); + /// + /// Returns a weekly aggregate of the number of additions and deletions pushed to a repository. + /// + /// The ID of the repository + /// Returns a weekly aggregate of the number additions and deletion + IObservable GetCodeFrequency(int repositoryId); + /// /// Returns the total commit counts for the owner and total commit counts in total. /// @@ -43,6 +64,13 @@ namespace Octokit.Reactive /// Returns from oldest week to now IObservable GetParticipation(string owner, string name); + /// + /// Returns the total commit counts for the owner and total commit counts in total. + /// + /// The ID of the repository + /// Returns from oldest week to now + IObservable GetParticipation(int repositoryId); + /// /// Returns a list of the number of commits per hour in each day /// @@ -50,5 +78,12 @@ namespace Octokit.Reactive /// The name of the repository /// Returns commit counts per hour in each day IObservable GetPunchCard(string owner, string name); + + /// + /// Returns a list of the number of commits per hour in each day + /// + /// The ID of the repository + /// Returns commit counts per hour in each day + IObservable GetPunchCard(int repositoryId); } } \ No newline at end of file diff --git a/Octokit.Reactive/Clients/ObservableStatisticsClient.cs b/Octokit.Reactive/Clients/ObservableStatisticsClient.cs index 16a67d9d..76e5913a 100644 --- a/Octokit.Reactive/Clients/ObservableStatisticsClient.cs +++ b/Octokit.Reactive/Clients/ObservableStatisticsClient.cs @@ -17,6 +17,7 @@ namespace Octokit.Reactive public ObservableStatisticsClient(IGitHubClient client) { Ensure.ArgumentNotNull(client, "client"); + _client = client; } @@ -34,6 +35,16 @@ namespace Octokit.Reactive return _client.Repository.Statistics.GetContributors(owner, name).ToObservable(); } + /// + /// Returns a list of for the given repository + /// + /// The ID of the repository + /// A list of + public IObservable> GetContributors(int repositoryId) + { + return _client.Repository.Statistics.GetContributors(repositoryId).ToObservable(); + } + /// /// Returns the last year of commit activity grouped by week. /// @@ -48,6 +59,16 @@ namespace Octokit.Reactive return _client.Repository.Statistics.GetCommitActivity(owner, name).ToObservable(); } + /// + /// Returns the last year of commit activity grouped by week. + /// + /// The ID of the repository + /// The last year of + public IObservable GetCommitActivity(int repositoryId) + { + return _client.Repository.Statistics.GetCommitActivity(repositoryId).ToObservable(); + } + /// /// Returns a weekly aggregate of the number of additions and deletions pushed to a repository. /// @@ -62,6 +83,16 @@ namespace Octokit.Reactive return _client.Repository.Statistics.GetCodeFrequency(owner, name).ToObservable(); } + /// + /// Returns a weekly aggregate of the number of additions and deletions pushed to a repository. + /// + /// The ID of the repository + /// Returns a weekly aggregate of the number additions and deletion + public IObservable GetCodeFrequency(int repositoryId) + { + return _client.Repository.Statistics.GetCodeFrequency(repositoryId).ToObservable(); + } + /// /// Returns the total commit counts for the owner and total commit counts in total. /// @@ -76,6 +107,16 @@ namespace Octokit.Reactive return _client.Repository.Statistics.GetParticipation(owner, name).ToObservable(); } + /// + /// Returns the total commit counts for the owner and total commit counts in total. + /// + /// The ID of the repository + /// Returns from oldest week to now + public IObservable GetParticipation(int repositoryId) + { + return _client.Repository.Statistics.GetParticipation(repositoryId).ToObservable(); + } + /// /// Returns a list of the number of commits per hour in each day /// @@ -89,5 +130,15 @@ namespace Octokit.Reactive return _client.Repository.Statistics.GetPunchCard(owner, name).ToObservable(); } + + /// + /// Returns a list of the number of commits per hour in each day + /// + /// The ID of the repository + /// Returns commit counts per hour in each day + public IObservable GetPunchCard(int repositoryId) + { + return _client.Repository.Statistics.GetPunchCard(repositoryId).ToObservable(); + } } -} \ No newline at end of file +} diff --git a/Octokit/Clients/IStatisticsClient.cs b/Octokit/Clients/IStatisticsClient.cs index da06d2a5..41da8219 100644 --- a/Octokit/Clients/IStatisticsClient.cs +++ b/Octokit/Clients/IStatisticsClient.cs @@ -20,6 +20,13 @@ namespace Octokit /// A list of Task> GetContributors(string owner, string name); + /// + /// Returns a list of for the given repository + /// + /// The ID of the repository + /// A list of + Task> GetContributors(int repositoryId); + /// /// Returns a list of for the given repository /// @@ -29,6 +36,14 @@ namespace Octokit /// A list of Task> GetContributors(string owner, string name, CancellationToken cancellationToken); + /// + /// Returns a list of for the given repository + /// + /// The ID of the repository + /// A token used to cancel this potentially long running request + /// A list of + Task> GetContributors(int repositoryId, CancellationToken cancellationToken); + /// /// Returns the last year of commit activity grouped by week. /// @@ -37,6 +52,13 @@ namespace Octokit /// The last year of Task GetCommitActivity(string owner, string name); + /// + /// Returns the last year of commit activity grouped by week. + /// + /// The ID of the repository + /// The last year of + Task GetCommitActivity(int repositoryId); + /// /// Returns the last year of commit activity grouped by week. /// @@ -46,6 +68,14 @@ namespace Octokit /// The last year of Task GetCommitActivity(string owner, string name, CancellationToken cancellationToken); + /// + /// Returns the last year of commit activity grouped by week. + /// + /// The ID of the repository + /// A token used to cancel this potentially long running request + /// The last year of + Task GetCommitActivity(int repositoryId, CancellationToken cancellationToken); + /// /// Returns a weekly aggregate of the number of additions and deletions pushed to a repository. /// @@ -54,6 +84,13 @@ namespace Octokit /// Returns a weekly aggregate of the number additions and deletion Task GetCodeFrequency(string owner, string name); + /// + /// Returns a weekly aggregate of the number of additions and deletions pushed to a repository. + /// + /// The ID of the repository + /// Returns a weekly aggregate of the number additions and deletion + Task GetCodeFrequency(int repositoryId); + /// /// Returns a weekly aggregate of the number of additions and deletions pushed to a repository. /// @@ -63,6 +100,14 @@ namespace Octokit /// Returns a weekly aggregate of the number additions and deletion Task GetCodeFrequency(string owner, string name, CancellationToken cancellationToken); + /// + /// Returns a weekly aggregate of the number of additions and deletions pushed to a repository. + /// + /// The ID of the repository + /// A token used to cancel this potentially long running request + /// Returns a weekly aggregate of the number additions and deletion + Task GetCodeFrequency(int repositoryId, CancellationToken cancellationToken); + /// /// Returns the total commit counts for the owner and total commit counts in total. /// @@ -71,6 +116,13 @@ namespace Octokit /// Returns from oldest week to now Task GetParticipation(string owner, string name); + /// + /// Returns the total commit counts for the owner and total commit counts in total. + /// + /// The ID of the repository + /// Returns from oldest week to now + Task GetParticipation(int repositoryId); + /// /// Returns the total commit counts for the owner and total commit counts in total. /// @@ -80,6 +132,14 @@ namespace Octokit /// Returns from oldest week to now Task GetParticipation(string owner, string name, CancellationToken cancellationToken); + /// + /// Returns the total commit counts for the owner and total commit counts in total. + /// + /// The ID of the repository + /// A token used to cancel this potentially long running request + /// Returns from oldest week to now + Task GetParticipation(int repositoryId, CancellationToken cancellationToken); + /// /// Returns a list of the number of commits per hour in each day /// @@ -88,6 +148,13 @@ namespace Octokit /// Returns commit counts per hour in each day Task GetPunchCard(string owner, string name); + /// + /// Returns a list of the number of commits per hour in each day + /// + /// The ID of the repository + /// Returns commit counts per hour in each day + Task GetPunchCard(int repositoryId); + /// /// Returns a list of the number of commits per hour in each day /// @@ -96,5 +163,13 @@ namespace Octokit /// A token used to cancel this potentially long running request /// Returns commit counts per hour in each day Task GetPunchCard(string owner, string name, CancellationToken cancellationToken); + + /// + /// Returns a list of the number of commits per hour in each day + /// + /// The ID of the repository + /// A token used to cancel this potentially long running request + /// Returns commit counts per hour in each day + Task GetPunchCard(int repositoryId, CancellationToken cancellationToken); } } \ No newline at end of file diff --git a/Octokit/Clients/StatisticsClient.cs b/Octokit/Clients/StatisticsClient.cs index 34aef9c8..03f69f78 100644 --- a/Octokit/Clients/StatisticsClient.cs +++ b/Octokit/Clients/StatisticsClient.cs @@ -29,9 +29,22 @@ namespace Octokit /// A list of public Task> GetContributors(string owner, string name) { + Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); + Ensure.ArgumentNotNullOrEmptyString(name, "name"); + return GetContributors(owner, name, CancellationToken.None); } + /// + /// Returns a list of for the given repository + /// + /// The ID of the repository + /// A list of + public Task> GetContributors(int repositoryId) + { + return GetContributors(repositoryId, CancellationToken.None); + } + /// /// Returns a list of for the given repository /// @@ -47,6 +60,17 @@ namespace Octokit return ApiConnection.GetQueuedOperation(ApiUrls.StatsContributors(owner, name), cancellationToken); } + /// + /// Returns a list of for the given repository + /// + /// The ID of the repository + /// A token used to cancel this potentially long running request + /// A list of + public Task> GetContributors(int repositoryId, CancellationToken cancellationToken) + { + return ApiConnection.GetQueuedOperation(ApiUrls.StatsContributors(repositoryId), cancellationToken); + } + /// /// Returns the last year of commit activity grouped by week. /// @@ -55,9 +79,22 @@ namespace Octokit /// The last year of public Task GetCommitActivity(string owner, string name) { + Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); + Ensure.ArgumentNotNullOrEmptyString(name, "name"); + return GetCommitActivity(owner, name, CancellationToken.None); } + /// + /// Returns the last year of commit activity grouped by week. + /// + /// The ID of the repository + /// The last year of + public Task GetCommitActivity(int repositoryId) + { + return GetCommitActivity(repositoryId, CancellationToken.None); + } + /// /// Returns the last year of commit activity grouped by week. /// @@ -75,6 +112,19 @@ namespace Octokit return new CommitActivity(activity); } + /// + /// Returns the last year of commit activity grouped by week. + /// + /// The ID of the repository + /// A token used to cancel this potentially long running request + /// The last year of + public async Task GetCommitActivity(int repositoryId, CancellationToken cancellationToken) + { + var activity = await ApiConnection.GetQueuedOperation( + ApiUrls.StatsCommitActivity(repositoryId), cancellationToken).ConfigureAwait(false); + return new CommitActivity(activity); + } + /// /// Returns a weekly aggregate of the number of additions and deletions pushed to a repository. /// @@ -83,9 +133,22 @@ namespace Octokit /// Returns a weekly aggregate of the number additions and deletion public Task GetCodeFrequency(string owner, string name) { + Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); + Ensure.ArgumentNotNullOrEmptyString(name, "name"); + return GetCodeFrequency(owner, name, CancellationToken.None); } + /// + /// Returns a weekly aggregate of the number of additions and deletions pushed to a repository. + /// + /// The ID of the repository + /// Returns a weekly aggregate of the number additions and deletion + public Task GetCodeFrequency(int repositoryId) + { + return GetCodeFrequency(repositoryId, CancellationToken.None); + } + /// /// Returns a weekly aggregate of the number of additions and deletions pushed to a repository. /// @@ -103,6 +166,19 @@ namespace Octokit return new CodeFrequency(rawFrequencies); } + /// + /// Returns a weekly aggregate of the number of additions and deletions pushed to a repository. + /// + /// The ID of the repository + /// A token used to cancel this potentially long running request + /// Returns a weekly aggregate of the number additions and deletion + public async Task GetCodeFrequency(int repositoryId, CancellationToken cancellationToken) + { + var rawFrequencies = await ApiConnection.GetQueuedOperation( + ApiUrls.StatsCodeFrequency(repositoryId), cancellationToken).ConfigureAwait(false); + return new CodeFrequency(rawFrequencies); + } + /// /// Returns the total commit counts for the owner and total commit counts in total. /// @@ -111,9 +187,22 @@ namespace Octokit /// Returns from oldest week to now public Task GetParticipation(string owner, string name) { + Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); + Ensure.ArgumentNotNullOrEmptyString(name, "name"); + return GetParticipation(owner, name, CancellationToken.None); } + /// + /// Returns the total commit counts for the owner and total commit counts in total. + /// + /// The ID of the repository + /// Returns from oldest week to now + public Task GetParticipation(int repositoryId) + { + return GetParticipation(repositoryId, CancellationToken.None); + } + /// /// Returns the total commit counts for the owner and total commit counts in total. /// @@ -131,6 +220,19 @@ namespace Octokit return result.FirstOrDefault(); } + /// + /// Returns the total commit counts for the owner and total commit counts in total. + /// + /// The ID of the repository + /// A token used to cancel this potentially long running request + /// Returns from oldest week to now + public async Task GetParticipation(int repositoryId, CancellationToken cancellationToken) + { + var result = await ApiConnection.GetQueuedOperation( + ApiUrls.StatsParticipation(repositoryId), cancellationToken).ConfigureAwait(false); + return result.FirstOrDefault(); + } + /// /// Returns a list of the number of commits per hour in each day /// @@ -139,9 +241,22 @@ namespace Octokit /// Returns commit counts per hour in each day public Task GetPunchCard(string owner, string name) { + Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); + Ensure.ArgumentNotNullOrEmptyString(name, "name"); + return GetPunchCard(owner, name, CancellationToken.None); } + /// + /// Returns a list of the number of commits per hour in each day + /// + /// The ID of the repository + /// Returns commit counts per hour in each day + public Task GetPunchCard(int repositoryId) + { + return GetPunchCard(repositoryId, CancellationToken.None); + } + /// /// Returns a list of the number of commits per hour in each day /// @@ -158,5 +273,18 @@ namespace Octokit ApiUrls.StatsPunchCard(owner, name), cancellationToken).ConfigureAwait(false); return new PunchCard(punchCardData); } + + /// + /// Returns a list of the number of commits per hour in each day + /// + /// The ID of the repository + /// A token used to cancel this potentially long running request + /// Returns commit counts per hour in each day + public async Task GetPunchCard(int repositoryId, CancellationToken cancellationToken) + { + var punchCardData = await ApiConnection.GetQueuedOperation( + ApiUrls.StatsPunchCard(repositoryId), cancellationToken).ConfigureAwait(false); + return new PunchCard(punchCardData); + } } } \ No newline at end of file From ce5388eef5ca26f2be568f54463530ee45186c6d Mon Sep 17 00:00:00 2001 From: Alexander Efremov Date: Mon, 13 Jun 2016 13:06:31 +0700 Subject: [PATCH 4/8] added new unit tests --- .../Clients/StatisticsClientTests.cs | 397 ++++++++++++++++-- .../ObservableStatisticsClientTests.cs | 181 +++++++- 2 files changed, 519 insertions(+), 59 deletions(-) diff --git a/Octokit.Tests/Clients/StatisticsClientTests.cs b/Octokit.Tests/Clients/StatisticsClientTests.cs index 6b2b6ece..c117bd03 100644 --- a/Octokit.Tests/Clients/StatisticsClientTests.cs +++ b/Octokit.Tests/Clients/StatisticsClientTests.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; +using System.Threading; using System.Threading.Tasks; using NSubstitute; using Octokit.Helpers; @@ -22,32 +23,87 @@ namespace Octokit.Tests.Clients public class TheGetContributorsMethod { [Fact] - public async Task RetrievesContributorsForCorrectUrl() + public async Task RequestsCorrectUrl() { - var expectedEndPoint = new Uri("repos/username/repositoryName/stats/contributors", UriKind.Relative); - var client = Substitute.For(); + var expectedEndPoint = new Uri("repos/owner/name/stats/contributors", UriKind.Relative); IReadOnlyList contributors = new ReadOnlyCollection(new[] { new Contributor() }); - client.GetQueuedOperation(expectedEndPoint, Args.CancellationToken) - .Returns(Task.FromResult(contributors)); - var statisticsClient = new StatisticsClient(client); - var result = await statisticsClient.GetContributors("username", "repositoryName"); + var connection = Substitute.For(); + connection.GetQueuedOperation(expectedEndPoint, Args.CancellationToken) + .Returns(Task.FromResult(contributors)); + + var client = new StatisticsClient(connection); + + var result = await client.GetContributors("owner", "name"); Assert.Equal(1, result.Count); } [Fact] - public async Task ThrowsIfGivenNullOwner() + public async Task RequestsCorrectUrlWithRepositoryId() { - var statisticsClient = new StatisticsClient(Substitute.For()); - await Assert.ThrowsAsync(() => statisticsClient.GetContributors(null, "repositoryName")); + var expectedEndPoint = new Uri("repositories/1/stats/contributors", UriKind.Relative); + IReadOnlyList contributors = new ReadOnlyCollection(new[] { new Contributor() }); + + var connection = Substitute.For(); + connection.GetQueuedOperation(expectedEndPoint, Args.CancellationToken) + .Returns(Task.FromResult(contributors)); + + var client = new StatisticsClient(connection); + + var result = await client.GetContributors(1); + + Assert.Equal(1, result.Count); } [Fact] - public async Task ThrowsIfGivenNullRepositoryName() + public async Task RequestsCorrectUrlWithCancellactionToken() { - var statisticsClient = new StatisticsClient(Substitute.For()); - await Assert.ThrowsAsync(() => statisticsClient.GetContributors("owner", null)); + var expectedEndPoint = new Uri("repos/owner/name/stats/contributors", UriKind.Relative); + IReadOnlyList contributors = new ReadOnlyCollection(new[] { new Contributor() }); + var cancellationToken = new CancellationToken(true); + + var connection = Substitute.For(); + + connection.GetQueuedOperation(expectedEndPoint, cancellationToken) + .Returns(Task.FromResult(contributors)); + + var client = new StatisticsClient(connection); + + var result = await client.GetContributors("owner", "name", cancellationToken); + + Assert.Equal(1, result.Count); + } + + [Fact] + public async Task RequestsCorrectUrlWithRepositoryIdWithCancellactionToken() + { + var expectedEndPoint = new Uri("repositories/1/stats/contributors", UriKind.Relative); + IReadOnlyList contributors = new ReadOnlyCollection(new[] { new Contributor() }); + var cancellationToken = new CancellationToken(true); + + var connection = Substitute.For(); + + connection.GetQueuedOperation(expectedEndPoint, cancellationToken) + .Returns(Task.FromResult(contributors)); + + var client = new StatisticsClient(connection); + + var result = await client.GetContributors(1, cancellationToken); + + Assert.Equal(1, result.Count); + } + + [Fact] + public async Task EnsureNonNullArguments() + { + var client = new StatisticsClient(Substitute.For()); + + await Assert.ThrowsAsync(() => client.GetContributors(null, "name")); + await Assert.ThrowsAsync(() => client.GetContributors("owner", null)); + + await Assert.ThrowsAsync(() => client.GetContributors("", "name")); + await Assert.ThrowsAsync(() => client.GetContributors("owner", "")); } } @@ -56,7 +112,7 @@ namespace Octokit.Tests.Clients [Fact] public async Task RequestsCorrectUrl() { - var expectedEndPoint = new Uri("repos/username/repositoryName/stats/commit_activity", UriKind.Relative); + var expectedEndPoint = new Uri("repos/owner/name/stats/commit_activity", UriKind.Relative); var data = new WeeklyCommitActivity(new[] { 1, 2 }, 100, 42); IReadOnlyList response = new ReadOnlyCollection(new[] { data }); @@ -65,7 +121,7 @@ namespace Octokit.Tests.Clients .Returns(Task.FromResult(response)); var statisticsClient = new StatisticsClient(client); - var result = await statisticsClient.GetCommitActivity("username", "repositoryName"); + var result = await statisticsClient.GetCommitActivity("owner", "name"); Assert.Equal(2, result.Activity[0].Days.Count); Assert.Equal(1, result.Activity[0].Days[0]); @@ -75,17 +131,82 @@ namespace Octokit.Tests.Clients } [Fact] - public async Task ThrowsIfGivenNullOwner() + public async Task RequestsCorrectUrlWithRepositoryId() { - var statisticsClient = new StatisticsClient(Substitute.For()); - await Assert.ThrowsAsync(() => statisticsClient.GetCommitActivity(null, "repositoryName")); + var expectedEndPoint = new Uri("repositories/1/stats/commit_activity", UriKind.Relative); + + var data = new WeeklyCommitActivity(new[] { 1, 2 }, 100, 42); + IReadOnlyList response = new ReadOnlyCollection(new[] { data }); + var client = Substitute.For(); + client.GetQueuedOperation(expectedEndPoint, Args.CancellationToken) + .Returns(Task.FromResult(response)); + var statisticsClient = new StatisticsClient(client); + + var result = await statisticsClient.GetCommitActivity(1); + + Assert.Equal(2, result.Activity[0].Days.Count); + Assert.Equal(1, result.Activity[0].Days[0]); + Assert.Equal(2, result.Activity[0].Days[1]); + Assert.Equal(100, result.Activity[0].Total); + Assert.Equal(42, result.Activity[0].Week); } [Fact] - public async Task ThrowsIfGivenNullRepositoryName() + public async Task RequestsCorrectUrlWithCancellationToken() { - var statisticsClient = new StatisticsClient(Substitute.For()); - await Assert.ThrowsAsync(() => statisticsClient.GetCommitActivity("owner", null)); + var expectedEndPoint = new Uri("repos/owner/name/stats/commit_activity", UriKind.Relative); + var cancellationToken = new CancellationToken(); + + var data = new WeeklyCommitActivity(new[] { 1, 2 }, 100, 42); + IReadOnlyList response = new ReadOnlyCollection(new[] { data }); + var connection = Substitute.For(); + connection.GetQueuedOperation(expectedEndPoint, cancellationToken) + .Returns(Task.FromResult(response)); + + var client = new StatisticsClient(connection); + + var result = await client.GetCommitActivity("owner", "name", cancellationToken); + + Assert.Equal(2, result.Activity[0].Days.Count); + Assert.Equal(1, result.Activity[0].Days[0]); + Assert.Equal(2, result.Activity[0].Days[1]); + Assert.Equal(100, result.Activity[0].Total); + Assert.Equal(42, result.Activity[0].Week); + } + + [Fact] + public async Task RequestsCorrectUrlWithRepositoryIdWithCancellationToken() + { + var expectedEndPoint = new Uri("repositories/1/stats/commit_activity", UriKind.Relative); + var cancellationToken = new CancellationToken(); + + var data = new WeeklyCommitActivity(new[] { 1, 2 }, 100, 42); + IReadOnlyList response = new ReadOnlyCollection(new[] { data }); + var connection = Substitute.For(); + connection.GetQueuedOperation(expectedEndPoint, cancellationToken) + .Returns(Task.FromResult(response)); + + var client = new StatisticsClient(connection); + + var result = await client.GetCommitActivity(1, cancellationToken); + + Assert.Equal(2, result.Activity[0].Days.Count); + Assert.Equal(1, result.Activity[0].Days[0]); + Assert.Equal(2, result.Activity[0].Days[1]); + Assert.Equal(100, result.Activity[0].Total); + Assert.Equal(42, result.Activity[0].Week); + } + + [Fact] + public async Task EnsureNonNullArguments() + { + var client = new StatisticsClient(Substitute.For()); + + await Assert.ThrowsAsync(() => client.GetCommitActivity(null, "name")); + await Assert.ThrowsAsync(() => client.GetCommitActivity("owner", null)); + + await Assert.ThrowsAsync(() => client.GetCommitActivity("", "name")); + await Assert.ThrowsAsync(() => client.GetCommitActivity("owner", "")); } } @@ -94,7 +215,7 @@ namespace Octokit.Tests.Clients [Fact] public async Task RequestsCorrectUrl() { - var expectedEndPoint = new Uri("repos/username/repositoryName/stats/code_frequency", UriKind.Relative); + var expectedEndPoint = new Uri("repos/owner/name/stats/code_frequency", UriKind.Relative); long firstTimestamp = 159670861; long secondTimestamp = 0; @@ -108,7 +229,7 @@ namespace Octokit.Tests.Clients .Returns(Task.FromResult(data)); var statisticsClient = new StatisticsClient(client); - var codeFrequency = await statisticsClient.GetCodeFrequency("username", "repositoryName"); + var codeFrequency = await statisticsClient.GetCodeFrequency("owner", "name"); Assert.Equal(2, codeFrequency.AdditionsAndDeletionsByWeek.Count); Assert.Equal(firstTimestamp.FromUnixTime(), codeFrequency.AdditionsAndDeletionsByWeek[0].Timestamp); @@ -120,17 +241,103 @@ namespace Octokit.Tests.Clients } [Fact] - public async Task ThrowsIfGivenNullOwner() + public async Task RequestsCorrectUrlWithRepositoryId() { - var statisticsClient = new StatisticsClient(Substitute.For()); - await Assert.ThrowsAsync(() => statisticsClient.GetCodeFrequency(null, "repositoryName")); + var expectedEndPoint = new Uri("repositories/1/stats/code_frequency", UriKind.Relative); + + long firstTimestamp = 159670861; + long secondTimestamp = 0; + IReadOnlyList data = new ReadOnlyCollection(new[] + { + new[] { firstTimestamp, 10, 52 }, + new[] { secondTimestamp, 0, 9 } + }); + var client = Substitute.For(); + client.GetQueuedOperation(expectedEndPoint, Args.CancellationToken) + .Returns(Task.FromResult(data)); + var statisticsClient = new StatisticsClient(client); + + var codeFrequency = await statisticsClient.GetCodeFrequency(1); + + Assert.Equal(2, codeFrequency.AdditionsAndDeletionsByWeek.Count); + Assert.Equal(firstTimestamp.FromUnixTime(), codeFrequency.AdditionsAndDeletionsByWeek[0].Timestamp); + Assert.Equal(10, codeFrequency.AdditionsAndDeletionsByWeek[0].Additions); + Assert.Equal(52, codeFrequency.AdditionsAndDeletionsByWeek[0].Deletions); + Assert.Equal(secondTimestamp.FromUnixTime(), codeFrequency.AdditionsAndDeletionsByWeek[1].Timestamp); + Assert.Equal(0, codeFrequency.AdditionsAndDeletionsByWeek[1].Additions); + Assert.Equal(9, codeFrequency.AdditionsAndDeletionsByWeek[1].Deletions); } [Fact] - public async Task ThrowsIfGivenNullRepositoryName() + public async Task RequestsCorrectUrlWithCancellationToken() { - var statisticsClient = new StatisticsClient(Substitute.For()); - await Assert.ThrowsAsync(() => statisticsClient.GetCodeFrequency("owner", null)); + var expectedEndPoint = new Uri("repos/owner/name/stats/code_frequency", UriKind.Relative); + + var cancellationToken = new CancellationToken(); + long firstTimestamp = 159670861; + long secondTimestamp = 0; + IReadOnlyList data = new ReadOnlyCollection(new[] + { + new[] { firstTimestamp, 10, 52 }, + new[] { secondTimestamp, 0, 9 } + }); + + var connection = Substitute.For(); + connection.GetQueuedOperation(expectedEndPoint, cancellationToken) + .Returns(Task.FromResult(data)); + var client = new StatisticsClient(connection); + + var codeFrequency = await client.GetCodeFrequency("owner", "name", cancellationToken); + + Assert.Equal(2, codeFrequency.AdditionsAndDeletionsByWeek.Count); + Assert.Equal(firstTimestamp.FromUnixTime(), codeFrequency.AdditionsAndDeletionsByWeek[0].Timestamp); + Assert.Equal(10, codeFrequency.AdditionsAndDeletionsByWeek[0].Additions); + Assert.Equal(52, codeFrequency.AdditionsAndDeletionsByWeek[0].Deletions); + Assert.Equal(secondTimestamp.FromUnixTime(), codeFrequency.AdditionsAndDeletionsByWeek[1].Timestamp); + Assert.Equal(0, codeFrequency.AdditionsAndDeletionsByWeek[1].Additions); + Assert.Equal(9, codeFrequency.AdditionsAndDeletionsByWeek[1].Deletions); + } + + [Fact] + public async Task RequestsCorrectUrlWithRepositoryIdWithCancellationToken() + { + var expectedEndPoint = new Uri("repositories/1/stats/code_frequency", UriKind.Relative); + + var cancellationToken = new CancellationToken(); + long firstTimestamp = 159670861; + long secondTimestamp = 0; + IReadOnlyList data = new ReadOnlyCollection(new[] + { + new[] { firstTimestamp, 10, 52 }, + new[] { secondTimestamp, 0, 9 } + }); + + var connection = Substitute.For(); + connection.GetQueuedOperation(expectedEndPoint, cancellationToken) + .Returns(Task.FromResult(data)); + var client = new StatisticsClient(connection); + + var codeFrequency = await client.GetCodeFrequency(1, cancellationToken); + + Assert.Equal(2, codeFrequency.AdditionsAndDeletionsByWeek.Count); + Assert.Equal(firstTimestamp.FromUnixTime(), codeFrequency.AdditionsAndDeletionsByWeek[0].Timestamp); + Assert.Equal(10, codeFrequency.AdditionsAndDeletionsByWeek[0].Additions); + Assert.Equal(52, codeFrequency.AdditionsAndDeletionsByWeek[0].Deletions); + Assert.Equal(secondTimestamp.FromUnixTime(), codeFrequency.AdditionsAndDeletionsByWeek[1].Timestamp); + Assert.Equal(0, codeFrequency.AdditionsAndDeletionsByWeek[1].Additions); + Assert.Equal(9, codeFrequency.AdditionsAndDeletionsByWeek[1].Deletions); + } + + [Fact] + public async Task EnsureNonNullArguments() + { + var client = new StatisticsClient(Substitute.For()); + + await Assert.ThrowsAsync(() => client.GetCodeFrequency(null, "name")); + await Assert.ThrowsAsync(() => client.GetCodeFrequency("owner", null)); + + await Assert.ThrowsAsync(() => client.GetCodeFrequency("", "name")); + await Assert.ThrowsAsync(() => client.GetCodeFrequency("owner", "")); } } @@ -139,37 +346,76 @@ namespace Octokit.Tests.Clients [Fact] public void RequestsCorrectUrl() { - var expectedEndPoint = new Uri("repos/username/repositoryName/stats/participation", UriKind.Relative); + var expectedEndPoint = new Uri("repos/owner/name/stats/participation", UriKind.Relative); var client = Substitute.For(); var statisticsClient = new StatisticsClient(client); - statisticsClient.GetParticipation("username", "repositoryName"); + statisticsClient.GetParticipation("owner", "name"); client.Received().GetQueuedOperation(expectedEndPoint, Args.CancellationToken); } [Fact] - public async Task ThrowsIfGivenNullOwner() + public void RequestsCorrectUrlWithRepositoryId() { - var statisticsClient = new StatisticsClient(Substitute.For()); - await Assert.ThrowsAsync(() => statisticsClient.GetParticipation(null, "repositoryName")); + var expectedEndPoint = new Uri("repositories/1/stats/participation", UriKind.Relative); + + var client = Substitute.For(); + var statisticsClient = new StatisticsClient(client); + + statisticsClient.GetParticipation(1); + + client.Received().GetQueuedOperation(expectedEndPoint, Args.CancellationToken); } [Fact] - public async Task ThrowsIfGivenNullRepositoryName() + public void RequestsCorrectUrlWithCancellationToken() { - var statisticsClient = new StatisticsClient(Substitute.For()); - await Assert.ThrowsAsync(() => statisticsClient.GetParticipation("owner", null)); + var expectedEndPoint = new Uri("repos/owner/name/stats/participation", UriKind.Relative); + var cancellationToken = new CancellationToken(); + + var client = Substitute.For(); + var statisticsClient = new StatisticsClient(client); + + statisticsClient.GetParticipation("owner", "name", cancellationToken); + + client.Received().GetQueuedOperation(expectedEndPoint, cancellationToken); + } + + [Fact] + public void RequestsCorrectUrlWithRepositoryIdWithCancellationToken() + { + var expectedEndPoint = new Uri("repositories/1/stats/participation", UriKind.Relative); + var cancellationToken = new CancellationToken(); + + var client = Substitute.For(); + var statisticsClient = new StatisticsClient(client); + + statisticsClient.GetParticipation(1, cancellationToken); + + client.Received().GetQueuedOperation(expectedEndPoint, cancellationToken); + } + + [Fact] + public async Task EnsureNonNullArguments() + { + var client = new StatisticsClient(Substitute.For()); + + await Assert.ThrowsAsync(() => client.GetParticipation(null, "name")); + await Assert.ThrowsAsync(() => client.GetParticipation("owner", null)); + + await Assert.ThrowsAsync(() => client.GetParticipation("", "name")); + await Assert.ThrowsAsync(() => client.GetParticipation("owner", "")); } } public class TheGetHourlyCommitCountsMethod { [Fact] - public async Task RetrievesPunchCard() + public async Task RequestsCorrectUrl() { - var expectedEndPoint = new Uri("repos/username/repositoryName/stats/punch_card", UriKind.Relative); + var expectedEndPoint = new Uri("repos/owner/name/stats/punch_card", UriKind.Relative); var client = Substitute.For(); IReadOnlyList data = new ReadOnlyCollection(new[] { new[] { 2, 8, 42 } }); @@ -177,7 +423,7 @@ namespace Octokit.Tests.Clients .Returns(Task.FromResult(data)); var statisticsClient = new StatisticsClient(client); - var result = await statisticsClient.GetPunchCard("username", "repositoryName"); + var result = await statisticsClient.GetPunchCard("owner", "name"); Assert.Equal(1, result.PunchPoints.Count); Assert.Equal(DayOfWeek.Tuesday, result.PunchPoints[0].DayOfWeek); @@ -186,17 +432,76 @@ namespace Octokit.Tests.Clients } [Fact] - public async Task ThrowsIfGivenNullOwner() + public async Task RequestsCorrectUrlWithRepositoryId() { - var statisticsClient = new StatisticsClient(Substitute.For()); - await Assert.ThrowsAsync(() => statisticsClient.GetPunchCard(null, "repositoryName")); + var expectedEndPoint = new Uri("repositories/1/stats/punch_card", UriKind.Relative); + + var client = Substitute.For(); + IReadOnlyList data = new ReadOnlyCollection(new[] { new[] { 2, 8, 42 } }); + client.GetQueuedOperation(expectedEndPoint, Args.CancellationToken) + .Returns(Task.FromResult(data)); + var statisticsClient = new StatisticsClient(client); + + var result = await statisticsClient.GetPunchCard(1); + + Assert.Equal(1, result.PunchPoints.Count); + Assert.Equal(DayOfWeek.Tuesday, result.PunchPoints[0].DayOfWeek); + Assert.Equal(8, result.PunchPoints[0].HourOfTheDay); + Assert.Equal(42, result.PunchPoints[0].CommitCount); } [Fact] - public async Task ThrowsIfGivenNullRepositoryName() + public async Task RequestsCorrectUrlWithCancellationToken() { - var statisticsClient = new StatisticsClient(Substitute.For()); - await Assert.ThrowsAsync(() => statisticsClient.GetPunchCard("owner", null)); + var expectedEndPoint = new Uri("repos/owner/name/stats/punch_card", UriKind.Relative); + var cancellationToken = new CancellationToken(); + + var connection = Substitute.For(); + IReadOnlyList data = new ReadOnlyCollection(new[] { new[] { 2, 8, 42 } }); + + connection.GetQueuedOperation(expectedEndPoint, cancellationToken) + .Returns(Task.FromResult(data)); + var client = new StatisticsClient(connection); + + var result = await client.GetPunchCard("owner", "name", cancellationToken); + + Assert.Equal(1, result.PunchPoints.Count); + Assert.Equal(DayOfWeek.Tuesday, result.PunchPoints[0].DayOfWeek); + Assert.Equal(8, result.PunchPoints[0].HourOfTheDay); + Assert.Equal(42, result.PunchPoints[0].CommitCount); + } + + [Fact] + public async Task RequestsCorrectUrlWithRepositoryIdWithCancellationToken() + { + var expectedEndPoint = new Uri("repositories/1/stats/punch_card", UriKind.Relative); + var cancellationToken = new CancellationToken(); + + var connection = Substitute.For(); + IReadOnlyList data = new ReadOnlyCollection(new[] { new[] { 2, 8, 42 } }); + + connection.GetQueuedOperation(expectedEndPoint, cancellationToken) + .Returns(Task.FromResult(data)); + var client = new StatisticsClient(connection); + + var result = await client.GetPunchCard(1, cancellationToken); + + Assert.Equal(1, result.PunchPoints.Count); + Assert.Equal(DayOfWeek.Tuesday, result.PunchPoints[0].DayOfWeek); + Assert.Equal(8, result.PunchPoints[0].HourOfTheDay); + Assert.Equal(42, result.PunchPoints[0].CommitCount); + } + + [Fact] + public async Task EnsureNonNullArguments() + { + var client = new StatisticsClient(Substitute.For()); + + await Assert.ThrowsAsync(() => client.GetPunchCard(null, "name")); + await Assert.ThrowsAsync(() => client.GetPunchCard("owner", null)); + + await Assert.ThrowsAsync(() => client.GetPunchCard("", "name")); + await Assert.ThrowsAsync(() => client.GetPunchCard("owner", "")); } } } diff --git a/Octokit.Tests/Reactive/ObservableStatisticsClientTests.cs b/Octokit.Tests/Reactive/ObservableStatisticsClientTests.cs index 25141dab..910ee1ee 100644 --- a/Octokit.Tests/Reactive/ObservableStatisticsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableStatisticsClientTests.cs @@ -1,6 +1,4 @@ using System; -using System.Reactive.Threading.Tasks; -using System.Threading.Tasks; using NSubstitute; using Octokit.Reactive; using Xunit; @@ -18,32 +16,189 @@ namespace Octokit.Tests.Reactive } } - public class TheGetMethod + public class TheGetContributorsMethod { [Fact] - public void GetsFromClientIssueMilestone() + public void RequestsCorrectUrl() { var gitHubClient = Substitute.For(); var statisticsClient = new ObservableStatisticsClient(gitHubClient); - statisticsClient.GetContributors("username", "repositoryName"); + statisticsClient.GetContributors("owner", "name"); - gitHubClient.Repository.Statistics.Received().GetContributors("username", "repositoryName"); + gitHubClient.Repository.Statistics.Received().GetContributors("owner", "name"); } [Fact] - public async Task ThrowsIfGivenNullRepositoryName() + public void RequestsCorrectUrlWithRepositoryId() { - var statisticsClient = new ObservableStatisticsClient(Substitute.For()); - await Assert.ThrowsAsync(() => statisticsClient.GetContributors("owner", null).ToTask()); + var gitHubClient = Substitute.For(); + var statisticsClient = new ObservableStatisticsClient(gitHubClient); + + statisticsClient.GetContributors(1); + + gitHubClient.Repository.Statistics.Received().GetContributors(1); } [Fact] - public async Task ThrowsIfGivenNullOwnerName() + public void EnsureNonNullArguments() { - var statisticsClient = new ObservableStatisticsClient(Substitute.For()); - await Assert.ThrowsAsync(() => statisticsClient.GetContributors(null, "repositoryName").ToTask()); + var client = new ObservableStatisticsClient(Substitute.For()); + + Assert.Throws(() => client.GetContributors("owner", null)); + Assert.Throws(() => client.GetContributors(null, "name")); + + Assert.Throws(() => client.GetContributors("", "name")); + Assert.Throws(() => client.GetContributors("owner", "")); + } + } + + public class TheGetCommitActivityMethod + { + [Fact] + public void RequestsCorrectUrl() + { + var gitHubClient = Substitute.For(); + var statisticsClient = new ObservableStatisticsClient(gitHubClient); + + statisticsClient.GetCommitActivity("owner", "name"); + + gitHubClient.Repository.Statistics.Received().GetCommitActivity("owner", "name"); + } + + [Fact] + public void RequestsCorrectUrlWithRepositoryId() + { + var gitHubClient = Substitute.For(); + var statisticsClient = new ObservableStatisticsClient(gitHubClient); + + statisticsClient.GetCommitActivity(1); + + gitHubClient.Repository.Statistics.Received().GetCommitActivity(1); + } + + [Fact] + public void EnsureNonNullArguments() + { + var client = new ObservableStatisticsClient(Substitute.For()); + + Assert.Throws(() => client.GetCommitActivity("owner", null)); + Assert.Throws(() => client.GetCommitActivity(null, "name")); + + Assert.Throws(() => client.GetCommitActivity("", "name")); + Assert.Throws(() => client.GetCommitActivity("owner", "")); + } + } + + public class TheGetCodeFrequencyMethod + { + [Fact] + public void RequestsCorrectUrl() + { + var gitHubClient = Substitute.For(); + var statisticsClient = new ObservableStatisticsClient(gitHubClient); + + statisticsClient.GetCodeFrequency("owner", "name"); + + gitHubClient.Repository.Statistics.Received().GetCodeFrequency("owner", "name"); + } + + [Fact] + public void RequestsCorrectUrlWithRepositoryId() + { + var gitHubClient = Substitute.For(); + var statisticsClient = new ObservableStatisticsClient(gitHubClient); + + statisticsClient.GetCodeFrequency(1); + + gitHubClient.Repository.Statistics.Received().GetCodeFrequency(1); + } + + [Fact] + public void EnsureNonNullArguments() + { + var client = new ObservableStatisticsClient(Substitute.For()); + + Assert.Throws(() => client.GetCodeFrequency("owner", null)); + Assert.Throws(() => client.GetCodeFrequency(null, "name")); + + Assert.Throws(() => client.GetCodeFrequency("", "name")); + Assert.Throws(() => client.GetCodeFrequency("owner", "")); + } + } + + public class TheGetParticipationMethod + { + [Fact] + public void RequestsCorrectUrl() + { + var gitHubClient = Substitute.For(); + var statisticsClient = new ObservableStatisticsClient(gitHubClient); + + statisticsClient.GetParticipation("owner", "name"); + + gitHubClient.Repository.Statistics.Received().GetParticipation("owner", "name"); + } + + [Fact] + public void RequestsCorrectUrlWithRepositoryId() + { + var gitHubClient = Substitute.For(); + var statisticsClient = new ObservableStatisticsClient(gitHubClient); + + statisticsClient.GetParticipation(1); + + gitHubClient.Repository.Statistics.Received().GetParticipation(1); + } + + [Fact] + public void EnsureNonNullArguments() + { + var client = new ObservableStatisticsClient(Substitute.For()); + + Assert.Throws(() => client.GetParticipation("owner", null)); + Assert.Throws(() => client.GetParticipation(null, "name")); + + Assert.Throws(() => client.GetParticipation("", "name")); + Assert.Throws(() => client.GetParticipation("owner", "")); + } + } + + public class TheGetPunchCardMethod + { + [Fact] + public void RequestsCorrectUrl() + { + var gitHubClient = Substitute.For(); + var statisticsClient = new ObservableStatisticsClient(gitHubClient); + + statisticsClient.GetPunchCard("owner", "name"); + + gitHubClient.Repository.Statistics.Received().GetPunchCard("owner", "name"); + } + + [Fact] + public void RequestsCorrectUrlWithRepositoryId() + { + var gitHubClient = Substitute.For(); + var statisticsClient = new ObservableStatisticsClient(gitHubClient); + + statisticsClient.GetPunchCard(1); + + gitHubClient.Repository.Statistics.Received().GetPunchCard(1); + } + + [Fact] + public void EnsureNonNullArguments() + { + var client = new ObservableStatisticsClient(Substitute.For()); + + Assert.Throws(() => client.GetPunchCard("owner", null)); + Assert.Throws(() => client.GetPunchCard(null, "name")); + + Assert.Throws(() => client.GetPunchCard("", "name")); + Assert.Throws(() => client.GetPunchCard("owner", "")); } } } -} \ No newline at end of file +} From 0aa2041f4d9404b0c7527574524afe6106dc4fef Mon Sep 17 00:00:00 2001 From: Alexander Efremov Date: Mon, 13 Jun 2016 13:11:42 +0700 Subject: [PATCH 5/8] added integration tests --- .../Clients/StatisticsClientTests.cs | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) diff --git a/Octokit.Tests.Integration/Clients/StatisticsClientTests.cs b/Octokit.Tests.Integration/Clients/StatisticsClientTests.cs index 2c257917..7efca125 100644 --- a/Octokit.Tests.Integration/Clients/StatisticsClientTests.cs +++ b/Octokit.Tests.Integration/Clients/StatisticsClientTests.cs @@ -37,6 +37,27 @@ namespace Octokit.Tests.Integration.Clients } } + [IntegrationTest] + public async Task CanCreateAndRetrieveContributorsWithRepositoryId() + { + using (var context = await _client.CreateRepositoryContext("public-repo")) + { + var repository = new RepositorySummary(context); + await CommitToRepository(repository); + var contributors = await _client.Repository.Statistics.GetContributors(context.Repository.Id); + + Assert.NotNull(contributors); + Assert.Equal(1, contributors.Count); + + var soleContributor = contributors.First(); + Assert.NotNull(soleContributor.Author); + Assert.True(soleContributor.Author.Login == repository.Owner); + + Assert.Equal(1, soleContributor.Weeks.Count); + Assert.Equal(1, soleContributor.Total); + } + } + [IntegrationTest] public async Task CanCreateAndRetrieveEmptyContributors() { @@ -51,6 +72,19 @@ namespace Octokit.Tests.Integration.Clients } } + [IntegrationTest] + public async Task CanCreateAndRetrieveEmptyContributorsWithRepositoryId() + { + var newRepository = new NewRepository(Helper.MakeNameWithTimestamp("public-repo")) { AutoInit = false }; + using (var context = await _client.CreateRepositoryContext(newRepository)) + { + var contributors = await _client.Repository.Statistics.GetContributors(context.Repository.Id); + + Assert.NotNull(contributors); + Assert.Empty(contributors); + } + } + [IntegrationTest] public async Task CanGetCommitActivityForTheLastYear() { @@ -58,6 +92,7 @@ namespace Octokit.Tests.Integration.Clients { var repository = new RepositorySummary(context); await CommitToRepository(repository); + var commitActivities = await _client.Repository.Statistics.GetCommitActivity(repository.Owner, repository.Name); Assert.NotNull(commitActivities); Assert.Equal(52, commitActivities.Activity.Count); @@ -68,6 +103,24 @@ namespace Octokit.Tests.Integration.Clients } } + [IntegrationTest] + public async Task CanGetCommitActivityForTheLastYearWithRepositoryId() + { + using (var context = await _client.CreateRepositoryContext("public-repo")) + { + var repository = new RepositorySummary(context); + await CommitToRepository(repository); + + var commitActivities = await _client.Repository.Statistics.GetCommitActivity(context.Repository.Id); + Assert.NotNull(commitActivities); + Assert.Equal(52, commitActivities.Activity.Count); + + var thisWeek = commitActivities.Activity.Last(); + Assert.Equal(1, thisWeek.Total); + Assert.NotNull(thisWeek.Days); + } + } + [IntegrationTest] public async Task CanGetAdditionsAndDeletionsPerWeek() { @@ -81,6 +134,20 @@ namespace Octokit.Tests.Integration.Clients } } + [IntegrationTest] + public async Task CanGetAdditionsAndDeletionsPerWeekWithRepositoryId() + { + using (var context = await _client.CreateRepositoryContext("public-repo")) + { + var repository = new RepositorySummary(context); + await CommitToRepository(repository); + + var commitActivities = await _client.Repository.Statistics.GetCodeFrequency(context.Repository.Id); + Assert.NotNull(commitActivities); + Assert.True(commitActivities.AdditionsAndDeletionsByWeek.Any()); + } + } + [IntegrationTest] public async Task CanGetParticipationStatistics() { @@ -93,6 +160,18 @@ namespace Octokit.Tests.Integration.Clients } } + [IntegrationTest] + public async Task CanGetParticipationStatisticsWithRepositoryId() + { + using (var context = await _client.CreateRepositoryContext("public-repo")) + { + var repository = new RepositorySummary(context); + await CommitToRepository(repository); + var weeklyCommitCounts = await _client.Repository.Statistics.GetParticipation(context.Repository.Id); + Assert.Equal(52, weeklyCommitCounts.All.Count); + } + } + [IntegrationTest] public async Task CanGetPunchCardForRepository() { @@ -106,6 +185,20 @@ namespace Octokit.Tests.Integration.Clients } } + [IntegrationTest] + public async Task CanGetPunchCardForRepositoryWithRepositoryId() + { + using (var context = await _client.CreateRepositoryContext("public-repo")) + { + var repository = new RepositorySummary(context); + await CommitToRepository(repository); + + var punchCard = await _client.Repository.Statistics.GetPunchCard(context.Repository.Id); + Assert.NotNull(punchCard); + Assert.NotNull(punchCard.PunchPoints); + } + } + private async Task CommitToRepository(RepositorySummary repositorySummary) { var owner = repositorySummary.Owner; From 2af9c0aec28f8368236e663a4e782e4db16b0a0e Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Tue, 14 Jun 2016 10:24:29 +1000 Subject: [PATCH 6/8] lock to an earlier version of mono (#1376) --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 5acd1c06..1244d3eb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,6 @@ language: csharp +mono: + - 4.2.3 sudo: false # use the new container-based Travis infrastructure os: From 08fd8e01c120bcf497391edac7f43a156e30e2d1 Mon Sep 17 00:00:00 2001 From: Alexander Efremov Date: Fri, 17 Jun 2016 05:49:46 +0700 Subject: [PATCH 7/8] cleared tags --- .../Clients/IObservableStatisticsClient.cs | 20 +++++----- .../Clients/ObservableStatisticsClient.cs | 20 +++++----- Octokit/Clients/IStatisticsClient.cs | 40 +++++++++---------- Octokit/Clients/StatisticsClient.cs | 40 +++++++++---------- 4 files changed, 60 insertions(+), 60 deletions(-) diff --git a/Octokit.Reactive/Clients/IObservableStatisticsClient.cs b/Octokit.Reactive/Clients/IObservableStatisticsClient.cs index ec81cf82..442e66ef 100644 --- a/Octokit.Reactive/Clients/IObservableStatisticsClient.cs +++ b/Octokit.Reactive/Clients/IObservableStatisticsClient.cs @@ -16,14 +16,14 @@ namespace Octokit.Reactive /// /// The owner of the repository /// The name of the repository - /// A list of + /// IObservable> GetContributors(string owner, string name); /// /// Returns a list of for the given repository /// /// The ID of the repository - /// A list of + /// IObservable> GetContributors(int repositoryId); /// @@ -31,14 +31,14 @@ namespace Octokit.Reactive /// /// The owner of the repository /// The name of the repository - /// The last year of + /// IObservable GetCommitActivity(string owner, string name); /// /// Returns the last year of commit activity grouped by week. /// /// The ID of the repository - /// The last year of + /// IObservable GetCommitActivity(int repositoryId); /// @@ -46,14 +46,14 @@ namespace Octokit.Reactive /// /// The owner of the repository /// The name of the repository - /// Returns a weekly aggregate of the number additions and deletion + /// IObservable GetCodeFrequency(string owner, string name); /// /// Returns a weekly aggregate of the number of additions and deletions pushed to a repository. /// /// The ID of the repository - /// Returns a weekly aggregate of the number additions and deletion + /// IObservable GetCodeFrequency(int repositoryId); /// @@ -61,14 +61,14 @@ namespace Octokit.Reactive /// /// The owner of the repository /// The name of the repository - /// Returns from oldest week to now + /// IObservable GetParticipation(string owner, string name); /// /// Returns the total commit counts for the owner and total commit counts in total. /// /// The ID of the repository - /// Returns from oldest week to now + /// IObservable GetParticipation(int repositoryId); /// @@ -76,14 +76,14 @@ namespace Octokit.Reactive /// /// The owner of the repository /// The name of the repository - /// Returns commit counts per hour in each day + /// IObservable GetPunchCard(string owner, string name); /// /// Returns a list of the number of commits per hour in each day /// /// The ID of the repository - /// Returns commit counts per hour in each day + /// IObservable GetPunchCard(int repositoryId); } } \ No newline at end of file diff --git a/Octokit.Reactive/Clients/ObservableStatisticsClient.cs b/Octokit.Reactive/Clients/ObservableStatisticsClient.cs index 76e5913a..9163485d 100644 --- a/Octokit.Reactive/Clients/ObservableStatisticsClient.cs +++ b/Octokit.Reactive/Clients/ObservableStatisticsClient.cs @@ -26,7 +26,7 @@ namespace Octokit.Reactive /// /// The owner of the repository /// The name of the repository - /// A list of + /// public IObservable> GetContributors(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -39,7 +39,7 @@ namespace Octokit.Reactive /// Returns a list of for the given repository /// /// The ID of the repository - /// A list of + /// public IObservable> GetContributors(int repositoryId) { return _client.Repository.Statistics.GetContributors(repositoryId).ToObservable(); @@ -50,7 +50,7 @@ namespace Octokit.Reactive /// /// The owner of the repository /// The name of the repository - /// The last year of + /// public IObservable GetCommitActivity(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -63,7 +63,7 @@ namespace Octokit.Reactive /// Returns the last year of commit activity grouped by week. /// /// The ID of the repository - /// The last year of + /// public IObservable GetCommitActivity(int repositoryId) { return _client.Repository.Statistics.GetCommitActivity(repositoryId).ToObservable(); @@ -74,7 +74,7 @@ namespace Octokit.Reactive /// /// The owner of the repository /// The name of the repository - /// Returns a weekly aggregate of the number additions and deletion + /// public IObservable GetCodeFrequency(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -87,7 +87,7 @@ namespace Octokit.Reactive /// Returns a weekly aggregate of the number of additions and deletions pushed to a repository. /// /// The ID of the repository - /// Returns a weekly aggregate of the number additions and deletion + /// public IObservable GetCodeFrequency(int repositoryId) { return _client.Repository.Statistics.GetCodeFrequency(repositoryId).ToObservable(); @@ -98,7 +98,7 @@ namespace Octokit.Reactive /// /// The owner of the repository /// The name of the repository - /// Returns from oldest week to now + /// public IObservable GetParticipation(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -111,7 +111,7 @@ namespace Octokit.Reactive /// Returns the total commit counts for the owner and total commit counts in total. /// /// The ID of the repository - /// Returns from oldest week to now + /// public IObservable GetParticipation(int repositoryId) { return _client.Repository.Statistics.GetParticipation(repositoryId).ToObservable(); @@ -122,7 +122,7 @@ namespace Octokit.Reactive /// /// The owner of the repository /// The name of the repository - /// Returns commit counts per hour in each day + /// public IObservable GetPunchCard(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -135,7 +135,7 @@ namespace Octokit.Reactive /// Returns a list of the number of commits per hour in each day /// /// The ID of the repository - /// Returns commit counts per hour in each day + /// public IObservable GetPunchCard(int repositoryId) { return _client.Repository.Statistics.GetPunchCard(repositoryId).ToObservable(); diff --git a/Octokit/Clients/IStatisticsClient.cs b/Octokit/Clients/IStatisticsClient.cs index 41da8219..e8a29071 100644 --- a/Octokit/Clients/IStatisticsClient.cs +++ b/Octokit/Clients/IStatisticsClient.cs @@ -17,14 +17,14 @@ namespace Octokit /// /// The owner of the repository /// The name of the repository - /// A list of + /// Task> GetContributors(string owner, string name); /// /// Returns a list of for the given repository /// /// The ID of the repository - /// A list of + /// Task> GetContributors(int repositoryId); /// @@ -33,7 +33,7 @@ namespace Octokit /// The owner of the repository /// The name of the repository /// A token used to cancel this potentially long running request - /// A list of + /// Task> GetContributors(string owner, string name, CancellationToken cancellationToken); /// @@ -41,7 +41,7 @@ namespace Octokit /// /// The ID of the repository /// A token used to cancel this potentially long running request - /// A list of + /// Task> GetContributors(int repositoryId, CancellationToken cancellationToken); /// @@ -49,14 +49,14 @@ namespace Octokit /// /// The owner of the repository /// The name of the repository - /// The last year of + /// Task GetCommitActivity(string owner, string name); /// /// Returns the last year of commit activity grouped by week. /// /// The ID of the repository - /// The last year of + /// Task GetCommitActivity(int repositoryId); /// @@ -65,7 +65,7 @@ namespace Octokit /// The owner of the repository /// The name of the repository /// A token used to cancel this potentially long running request - /// The last year of + /// Task GetCommitActivity(string owner, string name, CancellationToken cancellationToken); /// @@ -73,7 +73,7 @@ namespace Octokit /// /// The ID of the repository /// A token used to cancel this potentially long running request - /// The last year of + /// Task GetCommitActivity(int repositoryId, CancellationToken cancellationToken); /// @@ -81,14 +81,14 @@ namespace Octokit /// /// The owner of the repository /// The name of the repository - /// Returns a weekly aggregate of the number additions and deletion + /// Task GetCodeFrequency(string owner, string name); /// /// Returns a weekly aggregate of the number of additions and deletions pushed to a repository. /// /// The ID of the repository - /// Returns a weekly aggregate of the number additions and deletion + /// Task GetCodeFrequency(int repositoryId); /// @@ -97,7 +97,7 @@ namespace Octokit /// The owner of the repository /// The name of the repository /// A token used to cancel this potentially long running request - /// Returns a weekly aggregate of the number additions and deletion + /// Task GetCodeFrequency(string owner, string name, CancellationToken cancellationToken); /// @@ -105,7 +105,7 @@ namespace Octokit /// /// The ID of the repository /// A token used to cancel this potentially long running request - /// Returns a weekly aggregate of the number additions and deletion + /// Task GetCodeFrequency(int repositoryId, CancellationToken cancellationToken); /// @@ -113,14 +113,14 @@ namespace Octokit /// /// The owner of the repository /// The name of the repository - /// Returns from oldest week to now + /// Task GetParticipation(string owner, string name); /// /// Returns the total commit counts for the owner and total commit counts in total. /// /// The ID of the repository - /// Returns from oldest week to now + /// Task GetParticipation(int repositoryId); /// @@ -129,7 +129,7 @@ namespace Octokit /// The owner of the repository /// The name of the repository /// A token used to cancel this potentially long running request - /// Returns from oldest week to now + /// Task GetParticipation(string owner, string name, CancellationToken cancellationToken); /// @@ -137,7 +137,7 @@ namespace Octokit /// /// The ID of the repository /// A token used to cancel this potentially long running request - /// Returns from oldest week to now + /// Task GetParticipation(int repositoryId, CancellationToken cancellationToken); /// @@ -145,14 +145,14 @@ namespace Octokit /// /// The owner of the repository /// The name of the repository - /// Returns commit counts per hour in each day + /// Task GetPunchCard(string owner, string name); /// /// Returns a list of the number of commits per hour in each day /// /// The ID of the repository - /// Returns commit counts per hour in each day + /// Task GetPunchCard(int repositoryId); /// @@ -161,7 +161,7 @@ namespace Octokit /// The owner of the repository /// The name of the repository /// A token used to cancel this potentially long running request - /// Returns commit counts per hour in each day + /// Task GetPunchCard(string owner, string name, CancellationToken cancellationToken); /// @@ -169,7 +169,7 @@ namespace Octokit /// /// The ID of the repository /// A token used to cancel this potentially long running request - /// Returns commit counts per hour in each day + /// Task GetPunchCard(int repositoryId, CancellationToken cancellationToken); } } \ No newline at end of file diff --git a/Octokit/Clients/StatisticsClient.cs b/Octokit/Clients/StatisticsClient.cs index 03f69f78..07c1a6d6 100644 --- a/Octokit/Clients/StatisticsClient.cs +++ b/Octokit/Clients/StatisticsClient.cs @@ -26,7 +26,7 @@ namespace Octokit /// /// The owner of the repository /// The name of the repository - /// A list of + /// public Task> GetContributors(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -39,7 +39,7 @@ namespace Octokit /// Returns a list of for the given repository /// /// The ID of the repository - /// A list of + /// public Task> GetContributors(int repositoryId) { return GetContributors(repositoryId, CancellationToken.None); @@ -51,7 +51,7 @@ namespace Octokit /// The owner of the repository /// The name of the repository /// A token used to cancel this potentially long running request - /// A list of + /// public Task> GetContributors(string owner, string name, CancellationToken cancellationToken) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -65,7 +65,7 @@ namespace Octokit /// /// The ID of the repository /// A token used to cancel this potentially long running request - /// A list of + /// public Task> GetContributors(int repositoryId, CancellationToken cancellationToken) { return ApiConnection.GetQueuedOperation(ApiUrls.StatsContributors(repositoryId), cancellationToken); @@ -76,7 +76,7 @@ namespace Octokit /// /// The owner of the repository /// The name of the repository - /// The last year of + /// public Task GetCommitActivity(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -89,7 +89,7 @@ namespace Octokit /// Returns the last year of commit activity grouped by week. /// /// The ID of the repository - /// The last year of + /// public Task GetCommitActivity(int repositoryId) { return GetCommitActivity(repositoryId, CancellationToken.None); @@ -101,7 +101,7 @@ namespace Octokit /// The owner of the repository /// The name of the repository /// A token used to cancel this potentially long running request - /// The last year of + /// public async Task GetCommitActivity(string owner, string name, CancellationToken cancellationToken) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -117,7 +117,7 @@ namespace Octokit /// /// The ID of the repository /// A token used to cancel this potentially long running request - /// The last year of + /// public async Task GetCommitActivity(int repositoryId, CancellationToken cancellationToken) { var activity = await ApiConnection.GetQueuedOperation( @@ -130,7 +130,7 @@ namespace Octokit /// /// The owner of the repository /// The name of the repository - /// Returns a weekly aggregate of the number additions and deletion + /// public Task GetCodeFrequency(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -143,7 +143,7 @@ namespace Octokit /// Returns a weekly aggregate of the number of additions and deletions pushed to a repository. /// /// The ID of the repository - /// Returns a weekly aggregate of the number additions and deletion + /// public Task GetCodeFrequency(int repositoryId) { return GetCodeFrequency(repositoryId, CancellationToken.None); @@ -155,7 +155,7 @@ namespace Octokit /// The owner of the repository /// The name of the repository /// A token used to cancel this potentially long running request - /// Returns a weekly aggregate of the number additions and deletion + /// public async Task GetCodeFrequency(string owner, string name, CancellationToken cancellationToken) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -171,7 +171,7 @@ namespace Octokit /// /// The ID of the repository /// A token used to cancel this potentially long running request - /// Returns a weekly aggregate of the number additions and deletion + /// public async Task GetCodeFrequency(int repositoryId, CancellationToken cancellationToken) { var rawFrequencies = await ApiConnection.GetQueuedOperation( @@ -184,7 +184,7 @@ namespace Octokit /// /// The owner of the repository /// The name of the repository - /// Returns from oldest week to now + /// public Task GetParticipation(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -197,7 +197,7 @@ namespace Octokit /// Returns the total commit counts for the owner and total commit counts in total. /// /// The ID of the repository - /// Returns from oldest week to now + /// public Task GetParticipation(int repositoryId) { return GetParticipation(repositoryId, CancellationToken.None); @@ -209,7 +209,7 @@ namespace Octokit /// The owner of the repository /// The name of the repository /// A token used to cancel this potentially long running request - /// Returns from oldest week to now + /// public async Task GetParticipation(string owner, string name, CancellationToken cancellationToken) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -225,7 +225,7 @@ namespace Octokit /// /// The ID of the repository /// A token used to cancel this potentially long running request - /// Returns from oldest week to now + /// public async Task GetParticipation(int repositoryId, CancellationToken cancellationToken) { var result = await ApiConnection.GetQueuedOperation( @@ -238,7 +238,7 @@ namespace Octokit /// /// The owner of the repository /// The name of the repository - /// Returns commit counts per hour in each day + /// public Task GetPunchCard(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -251,7 +251,7 @@ namespace Octokit /// Returns a list of the number of commits per hour in each day /// /// The ID of the repository - /// Returns commit counts per hour in each day + /// public Task GetPunchCard(int repositoryId) { return GetPunchCard(repositoryId, CancellationToken.None); @@ -263,7 +263,7 @@ namespace Octokit /// The owner of the repository /// The name of the repository /// A token used to cancel this potentially long running request - /// Returns commit counts per hour in each day + /// public async Task GetPunchCard(string owner, string name, CancellationToken cancellationToken) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -279,7 +279,7 @@ namespace Octokit /// /// The ID of the repository /// A token used to cancel this potentially long running request - /// Returns commit counts per hour in each day + /// public async Task GetPunchCard(int repositoryId, CancellationToken cancellationToken) { var punchCardData = await ApiConnection.GetQueuedOperation( From 20df7ed7116347e3e8215796634f10f3ddce67f9 Mon Sep 17 00:00:00 2001 From: "aedampir@gmail.com" Date: Thu, 7 Jul 2016 03:08:54 +0700 Subject: [PATCH 8/8] removed tags --- .../Clients/IObservableStatisticsClient.cs | 10 ---------- .../Clients/ObservableStatisticsClient.cs | 10 ---------- Octokit/Clients/IStatisticsClient.cs | 20 ------------------- Octokit/Clients/StatisticsClient.cs | 20 ------------------- 4 files changed, 60 deletions(-) diff --git a/Octokit.Reactive/Clients/IObservableStatisticsClient.cs b/Octokit.Reactive/Clients/IObservableStatisticsClient.cs index 442e66ef..798602c4 100644 --- a/Octokit.Reactive/Clients/IObservableStatisticsClient.cs +++ b/Octokit.Reactive/Clients/IObservableStatisticsClient.cs @@ -16,14 +16,12 @@ namespace Octokit.Reactive /// /// The owner of the repository /// The name of the repository - /// IObservable> GetContributors(string owner, string name); /// /// Returns a list of for the given repository /// /// The ID of the repository - /// IObservable> GetContributors(int repositoryId); /// @@ -31,14 +29,12 @@ namespace Octokit.Reactive /// /// The owner of the repository /// The name of the repository - /// IObservable GetCommitActivity(string owner, string name); /// /// Returns the last year of commit activity grouped by week. /// /// The ID of the repository - /// IObservable GetCommitActivity(int repositoryId); /// @@ -46,14 +42,12 @@ namespace Octokit.Reactive /// /// The owner of the repository /// The name of the repository - /// IObservable GetCodeFrequency(string owner, string name); /// /// Returns a weekly aggregate of the number of additions and deletions pushed to a repository. /// /// The ID of the repository - /// IObservable GetCodeFrequency(int repositoryId); /// @@ -61,14 +55,12 @@ namespace Octokit.Reactive /// /// The owner of the repository /// The name of the repository - /// IObservable GetParticipation(string owner, string name); /// /// Returns the total commit counts for the owner and total commit counts in total. /// /// The ID of the repository - /// IObservable GetParticipation(int repositoryId); /// @@ -76,14 +68,12 @@ namespace Octokit.Reactive /// /// The owner of the repository /// The name of the repository - /// IObservable GetPunchCard(string owner, string name); /// /// Returns a list of the number of commits per hour in each day /// /// The ID of the repository - /// IObservable GetPunchCard(int repositoryId); } } \ No newline at end of file diff --git a/Octokit.Reactive/Clients/ObservableStatisticsClient.cs b/Octokit.Reactive/Clients/ObservableStatisticsClient.cs index 9163485d..f67ecfbe 100644 --- a/Octokit.Reactive/Clients/ObservableStatisticsClient.cs +++ b/Octokit.Reactive/Clients/ObservableStatisticsClient.cs @@ -26,7 +26,6 @@ namespace Octokit.Reactive /// /// The owner of the repository /// The name of the repository - /// public IObservable> GetContributors(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -39,7 +38,6 @@ namespace Octokit.Reactive /// Returns a list of for the given repository /// /// The ID of the repository - /// public IObservable> GetContributors(int repositoryId) { return _client.Repository.Statistics.GetContributors(repositoryId).ToObservable(); @@ -50,7 +48,6 @@ namespace Octokit.Reactive /// /// The owner of the repository /// The name of the repository - /// public IObservable GetCommitActivity(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -63,7 +60,6 @@ namespace Octokit.Reactive /// Returns the last year of commit activity grouped by week. /// /// The ID of the repository - /// public IObservable GetCommitActivity(int repositoryId) { return _client.Repository.Statistics.GetCommitActivity(repositoryId).ToObservable(); @@ -74,7 +70,6 @@ namespace Octokit.Reactive /// /// The owner of the repository /// The name of the repository - /// public IObservable GetCodeFrequency(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -87,7 +82,6 @@ namespace Octokit.Reactive /// Returns a weekly aggregate of the number of additions and deletions pushed to a repository. /// /// The ID of the repository - /// public IObservable GetCodeFrequency(int repositoryId) { return _client.Repository.Statistics.GetCodeFrequency(repositoryId).ToObservable(); @@ -98,7 +92,6 @@ namespace Octokit.Reactive /// /// The owner of the repository /// The name of the repository - /// public IObservable GetParticipation(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -111,7 +104,6 @@ namespace Octokit.Reactive /// Returns the total commit counts for the owner and total commit counts in total. /// /// The ID of the repository - /// public IObservable GetParticipation(int repositoryId) { return _client.Repository.Statistics.GetParticipation(repositoryId).ToObservable(); @@ -122,7 +114,6 @@ namespace Octokit.Reactive /// /// The owner of the repository /// The name of the repository - /// public IObservable GetPunchCard(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -135,7 +126,6 @@ namespace Octokit.Reactive /// Returns a list of the number of commits per hour in each day /// /// The ID of the repository - /// public IObservable GetPunchCard(int repositoryId) { return _client.Repository.Statistics.GetPunchCard(repositoryId).ToObservable(); diff --git a/Octokit/Clients/IStatisticsClient.cs b/Octokit/Clients/IStatisticsClient.cs index e8a29071..6c7383cb 100644 --- a/Octokit/Clients/IStatisticsClient.cs +++ b/Octokit/Clients/IStatisticsClient.cs @@ -17,14 +17,12 @@ namespace Octokit /// /// The owner of the repository /// The name of the repository - /// Task> GetContributors(string owner, string name); /// /// Returns a list of for the given repository /// /// The ID of the repository - /// Task> GetContributors(int repositoryId); /// @@ -33,7 +31,6 @@ namespace Octokit /// The owner of the repository /// The name of the repository /// A token used to cancel this potentially long running request - /// Task> GetContributors(string owner, string name, CancellationToken cancellationToken); /// @@ -41,7 +38,6 @@ namespace Octokit /// /// The ID of the repository /// A token used to cancel this potentially long running request - /// Task> GetContributors(int repositoryId, CancellationToken cancellationToken); /// @@ -49,14 +45,12 @@ namespace Octokit /// /// The owner of the repository /// The name of the repository - /// Task GetCommitActivity(string owner, string name); /// /// Returns the last year of commit activity grouped by week. /// /// The ID of the repository - /// Task GetCommitActivity(int repositoryId); /// @@ -65,7 +59,6 @@ namespace Octokit /// The owner of the repository /// The name of the repository /// A token used to cancel this potentially long running request - /// Task GetCommitActivity(string owner, string name, CancellationToken cancellationToken); /// @@ -73,7 +66,6 @@ namespace Octokit /// /// The ID of the repository /// A token used to cancel this potentially long running request - /// Task GetCommitActivity(int repositoryId, CancellationToken cancellationToken); /// @@ -81,14 +73,12 @@ namespace Octokit /// /// The owner of the repository /// The name of the repository - /// Task GetCodeFrequency(string owner, string name); /// /// Returns a weekly aggregate of the number of additions and deletions pushed to a repository. /// /// The ID of the repository - /// Task GetCodeFrequency(int repositoryId); /// @@ -97,7 +87,6 @@ namespace Octokit /// The owner of the repository /// The name of the repository /// A token used to cancel this potentially long running request - /// Task GetCodeFrequency(string owner, string name, CancellationToken cancellationToken); /// @@ -105,7 +94,6 @@ namespace Octokit /// /// The ID of the repository /// A token used to cancel this potentially long running request - /// Task GetCodeFrequency(int repositoryId, CancellationToken cancellationToken); /// @@ -113,14 +101,12 @@ namespace Octokit /// /// The owner of the repository /// The name of the repository - /// Task GetParticipation(string owner, string name); /// /// Returns the total commit counts for the owner and total commit counts in total. /// /// The ID of the repository - /// Task GetParticipation(int repositoryId); /// @@ -129,7 +115,6 @@ namespace Octokit /// The owner of the repository /// The name of the repository /// A token used to cancel this potentially long running request - /// Task GetParticipation(string owner, string name, CancellationToken cancellationToken); /// @@ -137,7 +122,6 @@ namespace Octokit /// /// The ID of the repository /// A token used to cancel this potentially long running request - /// Task GetParticipation(int repositoryId, CancellationToken cancellationToken); /// @@ -145,14 +129,12 @@ namespace Octokit /// /// The owner of the repository /// The name of the repository - /// Task GetPunchCard(string owner, string name); /// /// Returns a list of the number of commits per hour in each day /// /// The ID of the repository - /// Task GetPunchCard(int repositoryId); /// @@ -161,7 +143,6 @@ namespace Octokit /// The owner of the repository /// The name of the repository /// A token used to cancel this potentially long running request - /// Task GetPunchCard(string owner, string name, CancellationToken cancellationToken); /// @@ -169,7 +150,6 @@ namespace Octokit /// /// The ID of the repository /// A token used to cancel this potentially long running request - /// Task GetPunchCard(int repositoryId, CancellationToken cancellationToken); } } \ No newline at end of file diff --git a/Octokit/Clients/StatisticsClient.cs b/Octokit/Clients/StatisticsClient.cs index 07c1a6d6..a5305122 100644 --- a/Octokit/Clients/StatisticsClient.cs +++ b/Octokit/Clients/StatisticsClient.cs @@ -26,7 +26,6 @@ namespace Octokit /// /// The owner of the repository /// The name of the repository - /// public Task> GetContributors(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -39,7 +38,6 @@ namespace Octokit /// Returns a list of for the given repository /// /// The ID of the repository - /// public Task> GetContributors(int repositoryId) { return GetContributors(repositoryId, CancellationToken.None); @@ -51,7 +49,6 @@ namespace Octokit /// The owner of the repository /// The name of the repository /// A token used to cancel this potentially long running request - /// public Task> GetContributors(string owner, string name, CancellationToken cancellationToken) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -65,7 +62,6 @@ namespace Octokit /// /// The ID of the repository /// A token used to cancel this potentially long running request - /// public Task> GetContributors(int repositoryId, CancellationToken cancellationToken) { return ApiConnection.GetQueuedOperation(ApiUrls.StatsContributors(repositoryId), cancellationToken); @@ -76,7 +72,6 @@ namespace Octokit /// /// The owner of the repository /// The name of the repository - /// public Task GetCommitActivity(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -89,7 +84,6 @@ namespace Octokit /// Returns the last year of commit activity grouped by week. /// /// The ID of the repository - /// public Task GetCommitActivity(int repositoryId) { return GetCommitActivity(repositoryId, CancellationToken.None); @@ -101,7 +95,6 @@ namespace Octokit /// The owner of the repository /// The name of the repository /// A token used to cancel this potentially long running request - /// public async Task GetCommitActivity(string owner, string name, CancellationToken cancellationToken) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -117,7 +110,6 @@ namespace Octokit /// /// The ID of the repository /// A token used to cancel this potentially long running request - /// public async Task GetCommitActivity(int repositoryId, CancellationToken cancellationToken) { var activity = await ApiConnection.GetQueuedOperation( @@ -130,7 +122,6 @@ namespace Octokit /// /// The owner of the repository /// The name of the repository - /// public Task GetCodeFrequency(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -143,7 +134,6 @@ namespace Octokit /// Returns a weekly aggregate of the number of additions and deletions pushed to a repository. /// /// The ID of the repository - /// public Task GetCodeFrequency(int repositoryId) { return GetCodeFrequency(repositoryId, CancellationToken.None); @@ -155,7 +145,6 @@ namespace Octokit /// The owner of the repository /// The name of the repository /// A token used to cancel this potentially long running request - /// public async Task GetCodeFrequency(string owner, string name, CancellationToken cancellationToken) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -171,7 +160,6 @@ namespace Octokit /// /// The ID of the repository /// A token used to cancel this potentially long running request - /// public async Task GetCodeFrequency(int repositoryId, CancellationToken cancellationToken) { var rawFrequencies = await ApiConnection.GetQueuedOperation( @@ -184,7 +172,6 @@ namespace Octokit /// /// The owner of the repository /// The name of the repository - /// public Task GetParticipation(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -197,7 +184,6 @@ namespace Octokit /// Returns the total commit counts for the owner and total commit counts in total. /// /// The ID of the repository - /// public Task GetParticipation(int repositoryId) { return GetParticipation(repositoryId, CancellationToken.None); @@ -209,7 +195,6 @@ namespace Octokit /// The owner of the repository /// The name of the repository /// A token used to cancel this potentially long running request - /// public async Task GetParticipation(string owner, string name, CancellationToken cancellationToken) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -225,7 +210,6 @@ namespace Octokit /// /// The ID of the repository /// A token used to cancel this potentially long running request - /// public async Task GetParticipation(int repositoryId, CancellationToken cancellationToken) { var result = await ApiConnection.GetQueuedOperation( @@ -238,7 +222,6 @@ namespace Octokit /// /// The owner of the repository /// The name of the repository - /// public Task GetPunchCard(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -251,7 +234,6 @@ namespace Octokit /// Returns a list of the number of commits per hour in each day /// /// The ID of the repository - /// public Task GetPunchCard(int repositoryId) { return GetPunchCard(repositoryId, CancellationToken.None); @@ -263,7 +245,6 @@ namespace Octokit /// The owner of the repository /// The name of the repository /// A token used to cancel this potentially long running request - /// public async Task GetPunchCard(string owner, string name, CancellationToken cancellationToken) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -279,7 +260,6 @@ namespace Octokit /// /// The ID of the repository /// A token used to cancel this potentially long running request - /// public async Task GetPunchCard(int repositoryId, CancellationToken cancellationToken) { var punchCardData = await ApiConnection.GetQueuedOperation(