mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-05 03:30:34 +00:00
Added 'sort' parameter to the list forks api implementation.
This commit is contained in:
@@ -10,7 +10,7 @@ namespace Octokit.Tests.Integration.Clients
|
||||
public class TheGetMethod
|
||||
{
|
||||
[IntegrationTest]
|
||||
public async Task ReturnsForksForProject()
|
||||
public async Task ReturnsForksForRepository()
|
||||
{
|
||||
var github = Helper.GetAuthenticatedClient();
|
||||
|
||||
@@ -20,6 +20,20 @@ namespace Octokit.Tests.Integration.Clients
|
||||
Assert.NotNull(masterFork);
|
||||
Assert.Equal("TeamBinary", masterFork.Owner.Login);
|
||||
}
|
||||
|
||||
[IntegrationTest]
|
||||
public async Task ReturnsForksForRepositorySortingTheResultWithOldestFirst()
|
||||
{
|
||||
var github = Helper.GetAuthenticatedClient();
|
||||
|
||||
var actualForks = (await github.Repository.Forks.Get("octokit", "octokit.net", new RepositoryForksListRequest { Sort = Sort.Oldest })).ToArray();
|
||||
var sortedForks = actualForks.OrderBy(fork => fork.CreatedAt).ToArray();
|
||||
|
||||
for (var index = 0; index < actualForks.Length; index++)
|
||||
{
|
||||
Assert.Equal(sortedForks[index].FullName, actualForks[index].FullName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class TheCreateMethod
|
||||
|
||||
Reference in New Issue
Block a user