Get All repo commits with request parameters

Implemented Get All using the available parameters wrapped in a
CommitRequest object.  Added unit tests and xml documentation along the
way.
This commit is contained in:
Timothy Haagenson
2014-07-09 09:38:02 -05:00
parent f1b772e4e8
commit a72e39f98b
13 changed files with 145 additions and 3 deletions

View File

@@ -37,11 +37,25 @@ namespace Octokit.Reactive
/// <param name="name">The name of the repository</param>
/// <returns></returns>
public IObservable<GitHubCommit> GetAll(string owner, string name)
{
return GetAll(owner, name, new CommitRequest());
}
/// <summary>
/// Gets all commits for a given repository
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="request">Used to filter list of commits returned</param>
/// <returns></returns>
public IObservable<GitHubCommit> GetAll(string owner, string name, CommitRequest request)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
Ensure.ArgumentNotNull(request, "request");
return _connection.GetAndFlattenAllPages<GitHubCommit>(ApiUrls.RepositoryCommits(owner, name));
return _connection.GetAndFlattenAllPages<GitHubCommit>(ApiUrls.RepositoryCommits(owner, name),
request.ToParametersDictionary());
}
}
}