mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-05 23:06:10 +00:00
* Add release notes and bump version to 0.24 * run "build FormatCode" to fix up whitespace/formatting issues * Fix failing Ssh key tests due to "validation exception". This key must be in use on github (under another user, most likely from these tests failing). Changed to a new SSH key and tweaked tests to reduce chance of a key being created and not destroyed * Assignee and Assignees cant both be specified on NewIssue. We missed this one in the PR. Marked Assignee as [Obsolete] and fixed tests to use Assignees * Fix a couple of Reactions tests that were calling the wrong client methods * Fix timeline tests - looks like the response class has changed shape a bit, it now has an Issue object in the payload and Id field isnt present (leaving Id field there in case other timeline events do use it) * Fix some following tests that require the test user to follow more than 1 other user * Unskip these Event tests now because apparently they work! * add breaking changes notes * Update ApiErrorMessageSafe to return null for empty and whitespace strings (#1540) * return null if ApiError.Message is empty or whitespace * Uncomment test, which now passes * update release notes to include PR1540 * Add "Bot" AccountType, was causing a deserialization exception when running the integration test "SearchForExcludedLanguage" (#1541) * Update to include PR1541 * add bullets to make release notes easier to read * markup additional code mentions in notes * Fix grammar fields => field
76 lines
2.5 KiB
C#
76 lines
2.5 KiB
C#
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using Octokit.Reactive;
|
|
using System.Reactive.Linq;
|
|
using Xunit;
|
|
|
|
namespace Octokit.Tests.Integration.Reactive
|
|
{
|
|
public class ObservableRepositoryCommitsClientTests
|
|
{
|
|
public class TheGetAllMethod
|
|
{
|
|
readonly ObservableRepositoryCommitsClient _repositoryCommitsClient;
|
|
|
|
public TheGetAllMethod()
|
|
{
|
|
var client = Helper.GetAuthenticatedClient();
|
|
_repositoryCommitsClient = new ObservableRepositoryCommitsClient(client);
|
|
}
|
|
|
|
[IntegrationTest]
|
|
public async Task CanGetCorrectCountOfCommitsWithoutStart()
|
|
{
|
|
var options = new ApiOptions
|
|
{
|
|
PageSize = 5,
|
|
PageCount = 1
|
|
};
|
|
|
|
var commits = await _repositoryCommitsClient.GetAll("shiftkey", "ReactiveGit", options).ToList();
|
|
Assert.Equal(5, commits.Count);
|
|
}
|
|
|
|
[IntegrationTest]
|
|
public async Task CanGetCorrectCountOfCommitsWithStart()
|
|
{
|
|
var options = new ApiOptions
|
|
{
|
|
PageSize = 5,
|
|
PageCount = 1,
|
|
StartPage = 2
|
|
};
|
|
|
|
var commits = await _repositoryCommitsClient.GetAll("shiftkey", "ReactiveGit", options).ToList();
|
|
Assert.Equal(5, commits.Count);
|
|
}
|
|
|
|
[IntegrationTest]
|
|
public async Task ReturnsDistinctResultsBasedOnStart()
|
|
{
|
|
var startOptions = new ApiOptions
|
|
{
|
|
PageSize = 5,
|
|
PageCount = 1
|
|
};
|
|
|
|
var skipStartOptions = new ApiOptions
|
|
{
|
|
PageSize = 5,
|
|
PageCount = 1,
|
|
StartPage = 2
|
|
};
|
|
|
|
var firstCommit = await _repositoryCommitsClient.GetAll("shiftkey", "ReactiveGit", startOptions).ToList();
|
|
var secondCommit = await _repositoryCommitsClient.GetAll("shiftkey", "ReactiveGit", skipStartOptions).ToList();
|
|
|
|
Assert.NotEqual(firstCommit[0].Sha, secondCommit[0].Sha);
|
|
Assert.NotEqual(firstCommit[1].Sha, secondCommit[1].Sha);
|
|
Assert.NotEqual(firstCommit[2].Sha, secondCommit[2].Sha);
|
|
Assert.NotEqual(firstCommit[3].Sha, secondCommit[3].Sha);
|
|
Assert.NotEqual(firstCommit[4].Sha, secondCommit[4].Sha);
|
|
}
|
|
}
|
|
}
|
|
}
|