mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-06 07:16:09 +00:00
Add new ctor to PublicRepositoryRequest taking "since" parameter as a long, and obsolete the old ctor that uses an int
Update tests to pass long datatype
This commit is contained in:
@@ -683,7 +683,7 @@ public class RepositoriesClientTests
|
||||
{
|
||||
var github = Helper.GetAuthenticatedClient();
|
||||
|
||||
var request = new PublicRepositoryRequest(32732250);
|
||||
var request = new PublicRepositoryRequest(32732250L);
|
||||
var repositories = await github.Repository.GetAllPublic(request);
|
||||
|
||||
Assert.NotNull(repositories);
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace Octokit.Tests.Integration
|
||||
var github = Helper.GetAuthenticatedClient();
|
||||
|
||||
var client = new ObservableRepositoriesClient(github);
|
||||
var request = new PublicRepositoryRequest(32732250);
|
||||
var request = new PublicRepositoryRequest(32732250L);
|
||||
var repositories = await client.GetAllPublic(request).ToArray();
|
||||
Assert.NotEmpty(repositories);
|
||||
Assert.Equal(32732252, repositories[0].Id);
|
||||
|
||||
@@ -308,7 +308,7 @@ namespace Octokit.Tests.Clients
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
var client = new RepositoriesClient(connection);
|
||||
|
||||
await client.GetAllPublic(new PublicRepositoryRequest(364));
|
||||
await client.GetAllPublic(new PublicRepositoryRequest(364L));
|
||||
|
||||
connection.Received()
|
||||
.GetAll<Repository>(Arg.Is<Uri>(u => u.ToString() == "repositories?since=364"));
|
||||
@@ -320,7 +320,7 @@ namespace Octokit.Tests.Clients
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
var client = new RepositoriesClient(connection);
|
||||
|
||||
await client.GetAllPublic(new PublicRepositoryRequest(364));
|
||||
await client.GetAllPublic(new PublicRepositoryRequest(364L));
|
||||
|
||||
connection.Received()
|
||||
.GetAll<Repository>(Arg.Is<Uri>(u => u.ToString() == "repositories?since=364"));
|
||||
|
||||
@@ -311,7 +311,7 @@ namespace Octokit.Tests.Reactive
|
||||
|
||||
var repositoriesClient = new ObservableRepositoriesClient(gitHubClient);
|
||||
|
||||
var results = await repositoriesClient.GetAllPublic(new PublicRepositoryRequest(364)).ToArray();
|
||||
var results = await repositoriesClient.GetAllPublic(new PublicRepositoryRequest(364L)).ToArray();
|
||||
|
||||
Assert.Equal(7, results.Length);
|
||||
gitHubClient.Connection.Received(1).Get<List<Repository>>(firstPageUrl, null, null);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Diagnostics;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Octokit
|
||||
@@ -13,6 +14,7 @@ namespace Octokit
|
||||
/// Initializes a new instance of the <see cref="PublicRepositoryRequest"/> class.
|
||||
/// </summary>
|
||||
/// <param name="since">The integer Id of the last Repository that you’ve seen.</param>
|
||||
[Obsolete("Please use the alternative constructor taking a long, rather than int, typed parameter. This constructor will be removed in a future release.")]
|
||||
public PublicRepositoryRequest(int since)
|
||||
{
|
||||
Ensure.ArgumentNotNull(since, "since");
|
||||
@@ -20,6 +22,15 @@ namespace Octokit
|
||||
Since = since;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PublicRepositoryRequest"/> class.
|
||||
/// </summary>
|
||||
/// <param name="since">The Id of the last Repository that you’ve seen.</param>
|
||||
public PublicRepositoryRequest(long since)
|
||||
{
|
||||
Since = since;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the integer Id of the last Repository that you’ve seen.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user