StatusesRetweet() public method

public StatusesRetweet ( long statusId ) : Task>
statusId long
return Task>
Ejemplo n.º 1
0
        public async Task StatusesRetweet_Test()
        {
            using (var twitterApi = new TwitterApi())
            {
                var mock = new Mock <IApiConnection>();
                mock.Setup(x =>
                           x.PostLazyAsync <TwitterStatus>(
                               new Uri("statuses/retweet.json", UriKind.Relative),
                               new Dictionary <string, string> {
                    { "id", "100" },
                    { "include_entities", "true" },
                    { "include_ext_alt_text", "true" },
                    { "tweet_mode", "extended" },
                })
                           )
                .ReturnsAsync(LazyJson.Create(new TwitterStatus()));

                twitterApi.apiConnection = mock.Object;

                await twitterApi.StatusesRetweet(100L)
                .IgnoreResponse()
                .ConfigureAwait(false);

                mock.VerifyAll();
            }
        }
Ejemplo n.º 2
0
        public async Task StatusesRetweet_Test()
        {
            using (var twitterApi = new TwitterApi())
            {
                var mock = new Mock<IApiConnection>();
                mock.Setup(x =>
                    x.PostLazyAsync<TwitterStatus>(
                        new Uri("statuses/retweet.json", UriKind.Relative),
                        new Dictionary<string, string> {
                            { "id", "100" },
                            { "include_entities", "true" },
                            { "include_ext_alt_text", "true" },
                            { "tweet_mode", "extended" },
                        })
                )
                .ReturnsAsync(LazyJson.Create(new TwitterStatus()));

                twitterApi.apiConnection = mock.Object;

                await twitterApi.StatusesRetweet(100L)
                    .IgnoreResponse()
                    .ConfigureAwait(false);

                mock.VerifyAll();
            }
        }