StatusesShow() public method

public StatusesShow ( long statusId ) : Task
statusId long
return Task
示例#1
0
        public async Task StatusesShow_Test()
        {
            using (var twitterApi = new TwitterApi())
            {
                var mock = new Mock <IApiConnection>();
                mock.Setup(x =>
                           x.GetAsync <TwitterStatus>(
                               new Uri("statuses/show.json", UriKind.Relative),
                               new Dictionary <string, string> {
                    { "id", "100" },
                    { "include_entities", "true" },
                    { "include_ext_alt_text", "true" },
                    { "tweet_mode", "extended" },
                },
                               "/statuses/show/:id")
                           )
                .ReturnsAsync(new TwitterStatus {
                    Id = 100L
                });

                twitterApi.apiConnection = mock.Object;

                await twitterApi.StatusesShow(statusId : 100L)
                .ConfigureAwait(false);

                mock.VerifyAll();
            }
        }
示例#2
0
        public async Task StatusesShow_Test()
        {
            using (var twitterApi = new TwitterApi())
            {
                var mock = new Mock<IApiConnection>();
                mock.Setup(x =>
                    x.GetAsync<TwitterStatus>(
                        new Uri("statuses/show.json", UriKind.Relative),
                        new Dictionary<string, string> {
                            { "id", "100" },
                            { "include_entities", "true" },
                            { "include_ext_alt_text", "true" },
                            { "tweet_mode", "extended" },
                        },
                        "/statuses/show/:id")
                )
                .ReturnsAsync(new TwitterStatus { Id = 100L });

                twitterApi.apiConnection = mock.Object;

                await twitterApi.StatusesShow(statusId: 100L)
                    .ConfigureAwait(false);

                mock.VerifyAll();
            }
        }