mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-05-06 21:26:06 +00:00
Add tests
This commit is contained in:
@@ -273,6 +273,37 @@ namespace Octokit.Tests.Clients
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class TheGetAllPublicSinceMethod
|
||||
{
|
||||
[Fact]
|
||||
public void RequestsTheCorrectUrl()
|
||||
{
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
var client = new RepositoriesClient(connection);
|
||||
|
||||
client.GetAllPublic(new PublicRepositoryRequest { Since = 364 });
|
||||
|
||||
connection.Received()
|
||||
.GetAll<Repository>(Arg.Is<Uri>(u => u.ToString() == "/repositories"),
|
||||
Arg.Any<Dictionary<string, string>>());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SendsTheCorrectParameter()
|
||||
{
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
var client = new RepositoriesClient(connection);
|
||||
|
||||
client.GetAllPublic(new PublicRepositoryRequest { Since = 364 });
|
||||
|
||||
connection.Received()
|
||||
.GetAll<Repository>(Arg.Is<Uri>(u => u.ToString() == "/repositories"),
|
||||
Arg.Is<Dictionary<string, string>>(d => d.Count == 1
|
||||
&& d["since"] == "364"));
|
||||
}
|
||||
}
|
||||
|
||||
public class TheGetAllForCurrentMethod
|
||||
{
|
||||
[Fact]
|
||||
|
||||
Reference in New Issue
Block a user