mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-05 03:30:34 +00:00
Merge remote-tracking branch 'upstream/master' into add-user-permissions
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user