mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-01 10:25:36 +00:00
Write a timeline test that processes the most recent 20 closed PRs and 20 open Issues in octokit.net in attempt to more likely encounter a new EventType enum value added by github api changes
This commit is contained in:
@@ -50,6 +50,42 @@ namespace Octokit.Tests.Integration.Clients
|
||||
Assert.Equal(1, timelineEventInfos.Count);
|
||||
}
|
||||
|
||||
[IntegrationTest]
|
||||
public async Task CanRetrieveTimelineForRecentIssues()
|
||||
{
|
||||
// Make sure we can deserialize the event timeline for the 20 most recent closed PRs and 20 most recent open Issues from octokit.net
|
||||
|
||||
// Search request
|
||||
var github = Helper.GetAuthenticatedClient();
|
||||
var search = new SearchIssuesRequest
|
||||
{
|
||||
PerPage = 20,
|
||||
Page = 1
|
||||
};
|
||||
search.Repos.Add("octokit", "octokit.net");
|
||||
|
||||
// 20 most recent closed PRs
|
||||
search.Type = IssueTypeQualifier.PullRequest;
|
||||
search.State = ItemState.Closed;
|
||||
var pullRequestResults = await github.Search.SearchIssues(search);
|
||||
foreach (var pullRequest in pullRequestResults.Items)
|
||||
{
|
||||
var timelineEventInfos = await _issueTimelineClient.GetAllForIssue("octokit", "octokit.net", pullRequest.Number);
|
||||
Assert.NotEmpty(timelineEventInfos);
|
||||
}
|
||||
|
||||
// 20 most recent open Issues
|
||||
search.Type = IssueTypeQualifier.Issue;
|
||||
search.State = ItemState.Open;
|
||||
var issueResults = await github.Search.SearchIssues(search);
|
||||
foreach (var issue in issueResults.Items)
|
||||
{
|
||||
var timelineEventInfos = await _issueTimelineClient.GetAllForIssue("octokit", "octokit.net", issue.Number);
|
||||
|
||||
Assert.NotNull(timelineEventInfos);
|
||||
}
|
||||
}
|
||||
|
||||
[IntegrationTest]
|
||||
public async Task CanDeserializeRenameEvent()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user