Added ApiOption overloads to methods on IRepositoryCommitsClient (#1247)

* Added ApiOptions overloads for RepositoryCommitClient methods

* Added overloads to Reactive clients

* Integration tests in progress

* Integration test addition in progress

* More integration tests added

* Added Ensure things

* Minor changes

* Minor changes

* Few changes

* Tried to fix errors

* Tried to fix errors

* Fixed a few things

* Fixed integration tests

* Tidying up

* Added public keyword

* Added unit tests for GetAll() in normal and reactive methods

* Minor changes

* Changed the class name

* Fixed the unit test
This commit is contained in:
Prayank Mathur
2016-04-11 02:58:01 +05:30
committed by Brendan Forster
parent 4ae6000ac1
commit 43f6cfe28b
15 changed files with 358 additions and 30 deletions
@@ -42,6 +42,59 @@ public class RepositoryCommitsClientTests
Assert.NotEmpty(list);
}
[IntegrationTest]
public async Task CanGetCorrectCountOfCommitsWithoutStart()
{
var options = new ApiOptions
{
PageSize = 5,
PageCount = 1
};
var commits = await _fixture.GetAll("shiftkey", "ReactiveGit", options);
Assert.Equal(5, commits.Count);
}
[IntegrationTest]
public async Task CanGetCorrectCountOfCommitsWithStart()
{
var options = new ApiOptions
{
PageSize = 5,
PageCount = 1,
StartPage = 2
};
var commits = await _fixture.GetAll("shiftkey", "ReactiveGit", options);
Assert.Equal(5, commits.Count);
}
[IntegrationTest]
public async Task ReturnsDistinctResultsBasedOnStart()
{
var startOptions = new ApiOptions
{
PageSize = 5,
PageCount = 1,
};
var skipStartOptions = new ApiOptions
{
PageSize = 5,
PageCount = 1,
StartPage = 2
};
var firstCommit = await _fixture.GetAll("shiftkey", "ReactiveGit", startOptions);
var secondCommit = await _fixture.GetAll("shiftkey", "ReactiveGit", skipStartOptions);
Assert.NotEqual(firstCommit[0].Sha, secondCommit[0].Sha);
Assert.NotEqual(firstCommit[1].Sha, secondCommit[1].Sha);
Assert.NotEqual(firstCommit[2].Sha, secondCommit[2].Sha);
Assert.NotEqual(firstCommit[3].Sha, secondCommit[3].Sha);
Assert.NotEqual(firstCommit[4].Sha, secondCommit[4].Sha);
}
[IntegrationTest]
public async Task CanGetListOfCommitsBySha()
{