本文整理汇总了C#中GitHubClient.GetLastApiInfo方法的典型用法代码示例。如果您正苦于以下问题:C# GitHubClient.GetLastApiInfo方法的具体用法?C# GitHubClient.GetLastApiInfo怎么用?C# GitHubClient.GetLastApiInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GitHubClient
的用法示例。
在下文中一共展示了GitHubClient.GetLastApiInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReturnsObjectIfNotNew
public async Task ReturnsObjectIfNotNew()
{
var apiInfo = new ApiInfo(
new Dictionary<string, Uri>
{
{
"next",
new Uri("https://api.github.com/repos/rails/rails/issues?page=4&per_page=5")
},
{
"last",
new Uri("https://api.github.com/repos/rails/rails/issues?page=131&per_page=5")
},
{
"first",
new Uri("https://api.github.com/repos/rails/rails/issues?page=1&per_page=5")
},
{
"prev",
new Uri("https://api.github.com/repos/rails/rails/issues?page=2&per_page=5")
}
},
new List<string>
{
"user",
},
new List<string>
{
"user",
"public_repo",
"repo",
"gist"
},
"5634b0b187fd2e91e3126a75006cc4fa",
new RateLimit(100, 75, 1372700873)
);
var connection = Substitute.For<IConnection>();
connection.GetLastApiInfo().Returns(apiInfo);
var client = new GitHubClient(connection);
var result = client.GetLastApiInfo();
Assert.NotNull(result);
var temp = connection.Received(1).GetLastApiInfo();
}
示例2: ReturnsNullIfNew
public async Task ReturnsNullIfNew()
{
var connection = Substitute.For<IConnection>();
connection.GetLastApiInfo().Returns((ApiInfo)null);
var client = new GitHubClient(connection);
var result = client.GetLastApiInfo();
Assert.Null(result);
var temp = connection.Received(1).GetLastApiInfo();
}