mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-20 06:05:12 +00:00
Add ApiOptions overloads to methods on I(Observable)RepositoryDeployKeysClient (#1307)
This commit is contained in:
committed by
Brendan Forster
parent
289cae568b
commit
c4520123bf
@@ -55,7 +55,27 @@ namespace Octokit.Tests.Clients
|
||||
|
||||
deployKeysClient.GetAll("user", "repo");
|
||||
|
||||
apiConnection.Received().GetAll<DeployKey>(Arg.Is<Uri>(u => u.ToString() == "repos/user/repo/keys"));
|
||||
apiConnection.Received().GetAll<DeployKey>(Arg.Is<Uri>(u => u.ToString() == "repos/user/repo/keys"), Args.ApiOptions);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void GetsAListOfDeployKeysWithApiOptions()
|
||||
{
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
var client = new RepositoryDeployKeysClient(connection);
|
||||
|
||||
var options = new ApiOptions
|
||||
{
|
||||
PageCount = 1,
|
||||
PageSize = 1,
|
||||
StartPage = 1
|
||||
};
|
||||
|
||||
client.GetAll("user", "repo", options);
|
||||
|
||||
connection.Received(1)
|
||||
.GetAll<DeployKey>(Arg.Is<Uri>(u => u.ToString() == "repos/user/repo/keys"),
|
||||
options);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -63,10 +83,22 @@ namespace Octokit.Tests.Clients
|
||||
{
|
||||
var deployKeysClient = new RepositoryDeployKeysClient(Substitute.For<IApiConnection>());
|
||||
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => deployKeysClient.GetAll(null, null));
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => deployKeysClient.GetAll(null, "repo"));
|
||||
await Assert.ThrowsAsync<ArgumentException>(() => deployKeysClient.GetAll("", "repo"));
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => deployKeysClient.GetAll("user", null));
|
||||
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => deployKeysClient.GetAll(null, null, null));
|
||||
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => deployKeysClient.GetAll(null, null, ApiOptions.None));
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => deployKeysClient.GetAll(null, "repo", null));
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => deployKeysClient.GetAll("user", null, null));
|
||||
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => deployKeysClient.GetAll(null, "repo", ApiOptions.None));
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => deployKeysClient.GetAll("user", null, ApiOptions.None));
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => deployKeysClient.GetAll("user", "repo", null));
|
||||
|
||||
await Assert.ThrowsAsync<ArgumentException>(() => deployKeysClient.GetAll("user", ""));
|
||||
await Assert.ThrowsAsync<ArgumentException>(() => deployKeysClient.GetAll("", "repo"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user