forked from octokit/octokit.net
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5f4d939
commit bb169e7
Showing
2 changed files
with
54 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using System; | ||
using Octokit.Models.Request.Enterprise; | ||
using Xunit; | ||
|
||
namespace Octokit.Tests.Http | ||
{ | ||
public class PaginationTests | ||
{ | ||
public class TheShouldContinueMethod | ||
{ | ||
[Fact] | ||
public void HandlesMissingUri() | ||
{ | ||
var result = Pagination.ShouldContinue(null, null); | ||
Assert.False(result); | ||
} | ||
|
||
[Fact] | ||
public void HandlesIsDone() | ||
{ | ||
var uri = new Uri("http://example.com"); | ||
var options = new ApiOptionsExtended { IsDone = true }; | ||
var result = Pagination.ShouldContinue(uri, options); | ||
Assert.False(result); | ||
} | ||
|
||
[Fact] | ||
public void HandlesPageCountPageFirstParam() | ||
{ | ||
var uri = new Uri("http://example.com?page=2"); | ||
var options = new ApiOptions { StartPage = 1, PageCount = 1 }; | ||
var result = Pagination.ShouldContinue(uri, options); | ||
Assert.False(result); | ||
} | ||
|
||
[Fact] | ||
public void HandlesPageCountPageNotFirstParam() | ||
{ | ||
var uri = new Uri("http://example.com?page_size=100&page=2"); | ||
var options = new ApiOptions { StartPage = 1, PageCount = 1 }; | ||
var result = Pagination.ShouldContinue(uri, options); | ||
Assert.False(result); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters