本文整理汇总了C#中Statuses.BeginMentions方法的典型用法代码示例。如果您正苦于以下问题:C# Statuses.BeginMentions方法的具体用法?C# Statuses.BeginMentions怎么用?C# Statuses.BeginMentions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Statuses
的用法示例。
在下文中一共展示了Statuses.BeginMentions方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BeginMentions_WithDefaultParameters_HasParametersSet
public void BeginMentions_WithDefaultParameters_HasParametersSet()
{
// act
var twitterClient = Substitute.For<IBaseTwitterClient>();
twitterClient.When(a => a.BeginRequest(Arg.Any<string>(), Arg.Any<IDictionary<string, string>>(), Arg.Any<WebMethod>(), Arg.Any<RestCallback>()))
.Do(c =>
{
c.AssertParameter("trim_user", false);
c.AssertParameter("include_entities", false);
});
var statuses = new Statuses(twitterClient);
// act
statuses.BeginMentions((a, b, c) => { });
}
示例2: BeginMentions_WithParameters_HasParametersSet
public void BeginMentions_WithParameters_HasParametersSet()
{
// arrange
const int sinceId = 100;
const int maxId = 200;
const int count = 20;
const int page = 1;
const bool trimUser = true;
const bool includeEntities = true;
// act
var twitterClient = Substitute.For<IBaseTwitterClient>();
twitterClient.When(a => a.BeginRequest(Arg.Any<string>(), Arg.Any<IDictionary<string, string>>(), Arg.Any<WebMethod>(), Arg.Any<RestCallback>()))
.Do(c =>
{
c.AssertParameter("since_id", sinceId);
c.AssertParameter("max_id", maxId);
c.AssertParameter("count", count);
c.AssertParameter("page", page);
c.AssertParameter("trim_user", trimUser);
c.AssertParameter("include_entities", includeEntities);
});
var statuses = new Statuses(twitterClient);
// act
statuses.BeginMentions(sinceId, maxId, count, page, trimUser, includeEntities, (a, b, c) => { });
}
示例3: BeginMentions_WithDefaultParameters_WillReturnList
public void BeginMentions_WithDefaultParameters_WillReturnList()
{
// act
var wasCalled = false;
var twitterClient = Substitute.For<IBaseTwitterClient>();
twitterClient.SetReponseBasedOnRequestPath();
var statuses = new Statuses(twitterClient);
// assert
GenericResponseDelegate endGetMentions = (a, b, c) =>
{
wasCalled = true;
var tweet = c as ResultsWrapper<Tweet>;
Assert.That(tweet, Is.Not.Null);
Assert.That(tweet, Is.Not.Empty);
};
// act
statuses.BeginMentions(endGetMentions);
Assert.That(wasCalled, Errors.CallbackDidNotFire);
}