Merge remote-tracking branch 'upstream/master' into add-user-permissions

This commit is contained in:
Ryan Gribble
2016-06-06 21:24:55 +10:00
40 changed files with 5124 additions and 307 deletions
@@ -33,11 +33,47 @@ public class ObservableIssuesClientTests : IDisposable
}
[IntegrationTest]
public async Task ReturnsAllIssuesForARepository()
public async Task ReturnsPageOfIssuesForARepository()
{
var issues = await _client.GetAllForRepository("libgit2", "libgit2sharp").ToList();
var options = new ApiOptions
{
PageSize = 5,
PageCount = 1
};
Assert.NotEmpty(issues);
var issues = await _client.GetAllForRepository("libgit2", "libgit2sharp", options).ToList();
Assert.Equal(5, issues.Count);
}
[IntegrationTest]
public async Task ReturnsPageOfIssuesFromStartForARepository()
{
var first = new ApiOptions
{
PageSize = 5,
PageCount = 1
};
var firstPage = await _client.GetAllForRepository("libgit2", "libgit2sharp", first).ToList();
var second = new ApiOptions
{
PageSize = 5,
PageCount = 1,
StartPage = 2
};
var secondPage = await _client.GetAllForRepository("libgit2", "libgit2sharp", second).ToList();
Assert.Equal(5, firstPage.Count);
Assert.Equal(5, secondPage.Count);
Assert.NotEqual(firstPage[0].Id, secondPage[0].Id);
Assert.NotEqual(firstPage[1].Id, secondPage[1].Id);
Assert.NotEqual(firstPage[2].Id, secondPage[2].Id);
Assert.NotEqual(firstPage[3].Id, secondPage[3].Id);
Assert.NotEqual(firstPage[4].Id, secondPage[4].Id);
}
[IntegrationTest]