本文整理汇总了C#中Octokit.GistsClient.GetAllForUser方法的典型用法代码示例。如果您正苦于以下问题:C# GistsClient.GetAllForUser方法的具体用法?C# GistsClient.GetAllForUser怎么用?C# GistsClient.GetAllForUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Octokit.GistsClient
的用法示例。
在下文中一共展示了GistsClient.GetAllForUser方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RequestsCorrectGetGistsForAUserWithSinceUrl
public void RequestsCorrectGetGistsForAUserWithSinceUrl()
{
var connection = Substitute.For<IApiConnection>();
var client = new GistsClient(connection);
DateTimeOffset since = DateTimeOffset.Now;
client.GetAllForUser("octokit", since);
connection.Received().GetAll<Gist>(Arg.Is<Uri>(u => u.ToString() == "users/octokit/gists"),
Arg.Is<IDictionary<string, string>>(x => x.ContainsKey("since")));
}
示例2: RequestsCorrectGetGistsForAUserUrl
public void RequestsCorrectGetGistsForAUserUrl()
{
var connection = Substitute.For<IApiConnection>();
var client = new GistsClient(connection);
client.GetAllForUser("octokit");
connection.Received().GetAll<Gist>(Arg.Is<Uri>(u => u.ToString() == "users/octokit/gists"));
}
示例3: RequestsCorrectGetGistsForAUserWithSinceUrlAndApiOptions
public void RequestsCorrectGetGistsForAUserWithSinceUrlAndApiOptions()
{
var connection = Substitute.For<IApiConnection>();
var client = new GistsClient(connection);
var options = new ApiOptions
{
PageSize = 1,
PageCount = 1,
StartPage = 1
};
DateTimeOffset since = DateTimeOffset.Now;
client.GetAllForUser("octokit", since, options);
connection.Received().GetAll<Gist>(Arg.Is<Uri>(u => u.ToString() == "users/octokit/gists"),
DictionaryWithSince, options);
}
示例4: EnsureNonNullArguments
public async Task EnsureNonNullArguments()
{
var connection = Substitute.For<IApiConnection>();
var client = new GistsClient(connection);
await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForUser(null));
await Assert.ThrowsAsync<ArgumentException>(() => client.GetAllForUser(""));
await Assert.ThrowsAsync<ArgumentException>(() => client.GetAllForUser("", DateTimeOffset.Now));
await Assert.ThrowsAsync<ArgumentException>(() => client.GetAllForUser("", DateTimeOffset.Now, ApiOptions.None));
await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForUser("user", DateTimeOffset.Now, null));
}
示例5: RequestsCorrectGetGistsForAUserUrlWithApiOptions
public void RequestsCorrectGetGistsForAUserUrlWithApiOptions()
{
var connection = Substitute.For<IApiConnection>();
var client = new GistsClient(connection);
var options = new ApiOptions
{
PageSize = 1,
PageCount = 1,
StartPage = 1
};
client.GetAllForUser("octokit", options);
connection.Received().GetAll<Gist>(Arg.Is<Uri>(u => u.ToString() == "users/octokit/gists"), options);
}