add comments and tidy up

This commit is contained in:
Ryan Gribble
2015-12-26 23:49:01 +10:00
parent 0424205f72
commit 91ca43bf3c
5 changed files with 27 additions and 8 deletions
@@ -19,11 +19,11 @@ namespace Octokit.Tests.Clients
var connection = Substitute.For<IApiConnection>();
var client = new EnterpriseAdminStatsClient(connection);
foreach (AdminStatsType adminType in Enum.GetValues(typeof(AdminStatsType)))
foreach (AdminStatsType type in Enum.GetValues(typeof(AdminStatsType)))
{
client.GetStatistics(adminType);
client.GetStatistics(type);
connection.Received().Get<AdminStats>(Arg.Is<Uri>(u => u.ToString() == String.Concat("enterprise/stats/", adminType.ToString().ToLowerInvariant())), null);
connection.Received().Get<AdminStats>(Arg.Is<Uri>(u => u == "enterprise/stats/{0}".FormatUri(type.ToString().ToLowerInvariant())), null);
}
}
}
@@ -7,6 +7,12 @@ using System.Threading.Tasks;
namespace Octokit
{
/// <summary>
/// A client for GitHub's Enterprise Admin Stats API
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/enterprise/admin_stats/">Enterprise Admin Stats API documentation</a> for more information.
///</remarks>
public class EnterpriseAdminStatsClient : ApiClient, IEnterpriseAdminStatsClient
{
public EnterpriseAdminStatsClient(IApiConnection apiConnection)
@@ -14,7 +20,7 @@ namespace Octokit
{ }
/// <summary>
/// Gets all email addresses for the authenticated user.
/// Gets GitHub Enterprise statistics (must be Site Admin user).
/// </summary>
/// <remarks>
///https://developer.github.com/v3/enterprise/admin_stats/#get-statistics
@@ -4,10 +4,10 @@ using System.Threading.Tasks;
namespace Octokit
{
/// <summary>
/// A client for GitHub's Users API.
/// A client for GitHub's Enterprise API.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/users/">Users API documentation</a> for more information.
/// See the <a href="http://developer.github.com/v3/enterprise/">Enterprise API documentation</a> for more information.
/// </remarks>
public class EnterpriseClient : ApiClient, IEnterpriseClient
{
@@ -23,7 +23,7 @@ namespace Octokit
}
/// <summary>
/// A client for GitHub's Enterprise AdminStats API
/// A client for GitHub's Enterprise Admin Stats API
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/enterprise/admin_stats/">Enterprise Admin Stats API documentation</a> for more information.
@@ -6,8 +6,21 @@ using System.Threading.Tasks;
namespace Octokit
{
/// <summary>
/// A client for GitHub's Enterprise Admin Stats API
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/enterprise/admin_stats/">Enterprise Admin Stats API documentation</a> for more information.
///</remarks>
public interface IEnterpriseAdminStatsClient
{
/// <summary>
/// Gets GitHub Enterprise statistics (must be Site Admin user).
/// </summary>
/// <remarks>
///https://developer.github.com/v3/enterprise/admin_stats/#get-statistics
/// </remarks>
/// <returns>The <see cref="AdminStats"/> collection for the requested <see cref="AdminStatsType"/> type.</returns>
Task<AdminStats> GetStatistics(AdminStatsType type);
}
@@ -16,7 +16,7 @@ namespace Octokit
/// A client for GitHub's Enterprise Admin Stats API
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/enterprise/admin_stats/">Admin Stats API documentation</a> for more information.
/// See the <a href="http://developer.github.com/v3/enterprise/admin_stats/">Enterprise Admin Stats API documentation</a> for more information.
///</remarks>
IEnterpriseAdminStatsClient AdminStats { get; }
}