mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-06 07:16:09 +00:00
moved Statistics under Repository as per the docs
This commit is contained in:
@@ -19,7 +19,7 @@ namespace Octokit.Reactive
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||
Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName");
|
||||
|
||||
return _client.Statistics.GetContributors(owner, repositoryName).ToObservable();
|
||||
return _client.Repository.Statistics.GetContributors(owner, repositoryName).ToObservable();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,7 @@ namespace Octokit.Tests.Integration.Clients
|
||||
{
|
||||
var repository = await CreateRepository();
|
||||
await CommitToRepository(repository);
|
||||
var contributors = await _client.Statistics.GetContributors(repository.Owner, repository.Name);
|
||||
var contributors = await _client.Repository.Statistics.GetContributors(repository.Owner, repository.Name);
|
||||
|
||||
Assert.NotNull(contributors);
|
||||
Assert.True(contributors.Count() == 1);
|
||||
@@ -42,7 +42,7 @@ namespace Octokit.Tests.Integration.Clients
|
||||
{
|
||||
var repository = await CreateRepository();
|
||||
await CommitToRepository(repository);
|
||||
var commitActivities = await _client.Statistics.GetCommitActivity(repository.Owner, repository.Name);
|
||||
var commitActivities = await _client.Repository.Statistics.GetCommitActivity(repository.Owner, repository.Name);
|
||||
Assert.NotNull(commitActivities);
|
||||
Assert.True(commitActivities.Activity.Count() == 52);
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace Octokit.Tests.Integration.Clients
|
||||
{
|
||||
var repository = await CreateRepository();
|
||||
await CommitToRepository(repository);
|
||||
var commitActivities = await _client.Statistics.GetCodeFrequency(repository.Owner, repository.Name);
|
||||
var commitActivities = await _client.Repository.Statistics.GetCodeFrequency(repository.Owner, repository.Name);
|
||||
Assert.NotNull(commitActivities);
|
||||
Assert.True(commitActivities.AdditionsAndDeletionsByWeek.Any());
|
||||
}
|
||||
@@ -66,7 +66,7 @@ namespace Octokit.Tests.Integration.Clients
|
||||
{
|
||||
var repository = await CreateRepository();
|
||||
await CommitToRepository(repository);
|
||||
var weeklyCommitCounts = await _client.Statistics.GetParticipation(repository.Owner, repository.Name);
|
||||
var weeklyCommitCounts = await _client.Repository.Statistics.GetParticipation(repository.Owner, repository.Name);
|
||||
Assert.NotNull(weeklyCommitCounts);
|
||||
Assert.NotNull(weeklyCommitCounts.All);
|
||||
Assert.NotNull(weeklyCommitCounts.Owner);
|
||||
@@ -77,7 +77,7 @@ namespace Octokit.Tests.Integration.Clients
|
||||
{
|
||||
var repository = await CreateRepository();
|
||||
await CommitToRepository(repository);
|
||||
var punchCard = await _client.Statistics.GetPunchCard(repository.Owner, repository.Name);
|
||||
var punchCard = await _client.Repository.Statistics.GetPunchCard(repository.Owner, repository.Name);
|
||||
Assert.NotNull(punchCard);
|
||||
Assert.NotNull(punchCard.PunchPoints);
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Octokit.Tests.Reactive
|
||||
|
||||
statisticsClient.GetContributors("username", "repositoryName");
|
||||
|
||||
gitHubClient.Statistics.Received().GetContributors("username", "repositoryName");
|
||||
gitHubClient.Repository.Statistics.Received().GetContributors("username", "repositoryName");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
@@ -152,6 +152,14 @@ namespace Octokit
|
||||
/// </remarks>
|
||||
IDeploymentsClient Deployment { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Client for GitHub's Repository Statistics API
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/statistics/">Statistics API documentation</a> for more details
|
||||
///</remarks>
|
||||
IStatisticsClient Statistics { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets all the branches for the specified repository.
|
||||
/// </summary>
|
||||
|
||||
@@ -25,6 +25,7 @@ namespace Octokit
|
||||
CommitStatus = new CommitStatusClient(apiConnection);
|
||||
RepoCollaborators = new RepoCollaboratorsClient(apiConnection);
|
||||
Deployment = new DeploymentsClient(apiConnection);
|
||||
Statistics = new StatisticsClient(apiConnection);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -231,6 +232,14 @@ namespace Octokit
|
||||
/// </remarks>
|
||||
public IDeploymentsClient Deployment { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Client for GitHub's Repository Statistics API
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/statistics/">Statistics API documentation</a> for more details
|
||||
///</remarks>
|
||||
public IStatisticsClient Statistics { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets all the branches for the specified repository.
|
||||
/// </summary>
|
||||
|
||||
@@ -93,7 +93,6 @@ namespace Octokit
|
||||
GitDatabase = new GitDatabaseClient(apiConnection);
|
||||
Search = new SearchClient(apiConnection);
|
||||
Deployment = new DeploymentsClient(apiConnection);
|
||||
Statistics = new StatisticsClient(apiConnection);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -144,8 +143,6 @@ namespace Octokit
|
||||
public IGitDatabaseClient GitDatabase { get; private set; }
|
||||
public ISearchClient Search { get; private set; }
|
||||
public IDeploymentsClient Deployment { get; private set; }
|
||||
public IStatisticsClient Statistics { get; private set; }
|
||||
|
||||
static Uri FixUpBaseUri(Uri uri)
|
||||
{
|
||||
Ensure.ArgumentNotNull(uri, "uri");
|
||||
|
||||
@@ -22,6 +22,6 @@ namespace Octokit
|
||||
INotificationsClient Notification { get; }
|
||||
IGitDatabaseClient GitDatabase { get; }
|
||||
ISearchClient Search { get; }
|
||||
IStatisticsClient Statistics { get; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user