本文整理汇总了C#中Statuses.BeginUpdate方法的典型用法代码示例。如果您正苦于以下问题:C# Statuses.BeginUpdate方法的具体用法?C# Statuses.BeginUpdate怎么用?C# Statuses.BeginUpdate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Statuses
的用法示例。
在下文中一共展示了Statuses.BeginUpdate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BeginUpdate_WithInReplyToIdSet_PopulatesParameter
public void BeginUpdate_WithInReplyToIdSet_PopulatesParameter()
{
// act
const string inReplyToId = "12345";
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("in_reply_to_status_id", inReplyToId));
var statuses = new Statuses(twitterClient);
// assert
GenericResponseDelegate endBeginUpdate = (a, b, c) => { };
// act
statuses.BeginUpdate("some words go here", "12345", endBeginUpdate);
}
示例2: BeginUpdate_WithLocationSet_PopulatesParameters
public void BeginUpdate_WithLocationSet_PopulatesParameters()
{
// act
const double latitute = 10.0;
const double longitude = 15.0;
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("lat", latitute);
c.AssertParameter("long", longitude);
});
var statuses = new Statuses(twitterClient);
// assert
GenericResponseDelegate endBeginUpdate = (a, b, c) => { };
// act
statuses.BeginUpdate("some words go here", "12345", latitute, longitude, endBeginUpdate);
}
示例3: BeginUpdate_WithTextOnly_ReturnsValidResult
public void BeginUpdate_WithTextOnly_ReturnsValidResult()
{
// act
var wasCalled = false;
var twitterClient = Substitute.For<IBaseTwitterClient>();
twitterClient.SetResponse(File.ReadAllText(@".\Data\statuses\update-plain.json"));
var statuses = new Statuses(twitterClient);
// assert
GenericResponseDelegate endBeginUpdate = (a, b, c) =>
{
wasCalled = true;
var tweet = c as Tweet;
Assert.That(tweet, Is.Not.Null);
Assert.That(tweet.Id, Is.EqualTo(76362320393154561));
};
// act
statuses.BeginUpdate("some words go here", endBeginUpdate);
Assert.That(wasCalled, Errors.CallbackDidNotFire);
}