Add ApiOption overloads to methods on IRepositoryHooksClient (#1272)

This commit is contained in:
Alexander Efremov
2016-04-19 14:08:02 +07:00
committed by Brendan Forster
parent a44feaa7c3
commit 190ccf04c2
11 changed files with 370 additions and 11 deletions
@@ -1,7 +1,7 @@
using NSubstitute;
using System;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using NSubstitute;
using Xunit;
namespace Octokit.Tests.Clients
@@ -28,7 +28,28 @@ namespace Octokit.Tests.Clients
client.Hooks.GetAll("fake", "repo");
connection.Received().GetAll<RepositoryHook>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/hooks"));
connection.Received().GetAll<RepositoryHook>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/hooks"),
Args.ApiOptions);
}
[Fact]
public void RequestsCorrectUrlWithApiOptions()
{
var connection = Substitute.For<IApiConnection>();
var client = new RepositoriesClient(connection);
var options = new ApiOptions
{
PageCount = 1,
PageSize = 1,
StartPage = 1
};
client.Hooks.GetAll("fake", "repo", options);
connection.Received(1)
.GetAll<RepositoryHook>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/hooks"),
options);
}
[Fact]