StatusesUserTimeline() public méthode

public StatusesUserTimeline ( string screenName, int count = null, long maxId = null, long sinceId = null ) : Task
screenName string
count int
maxId long
sinceId long
Résultat Task
Exemple #1
0
        public async Task StatusesUserTimeline_Test()
        {
            using (var twitterApi = new TwitterApi())
            {
                var mock = new Mock <IApiConnection>();
                mock.Setup(x =>
                           x.GetAsync <TwitterStatus[]>(
                               new Uri("statuses/user_timeline.json", UriKind.Relative),
                               new Dictionary <string, string> {
                    { "screen_name", "twitterapi" },
                    { "include_rts", "true" },
                    { "include_entities", "true" },
                    { "include_ext_alt_text", "true" },
                    { "tweet_mode", "extended" },
                    { "count", "200" },
                    { "max_id", "900" },
                    { "since_id", "100" },
                },
                               "/statuses/user_timeline")
                           )
                .ReturnsAsync(new TwitterStatus[0]);

                twitterApi.apiConnection = mock.Object;

                await twitterApi.StatusesUserTimeline("twitterapi", count : 200, maxId : 900L, sinceId : 100L)
                .ConfigureAwait(false);

                mock.VerifyAll();
            }
        }
Exemple #2
0
        public async Task StatusesUserTimeline_Test()
        {
            using (var twitterApi = new TwitterApi())
            {
                var mock = new Mock<IApiConnection>();
                mock.Setup(x =>
                    x.GetAsync<TwitterStatus[]>(
                        new Uri("statuses/user_timeline.json", UriKind.Relative),
                        new Dictionary<string, string> {
                            { "screen_name", "twitterapi" },
                            { "include_rts", "true" },
                            { "include_entities", "true" },
                            { "include_ext_alt_text", "true" },
                            { "tweet_mode", "extended" },
                            { "count", "200" },
                            { "max_id", "900" },
                            { "since_id", "100" },
                        },
                        "/statuses/user_timeline")
                )
                .ReturnsAsync(new TwitterStatus[0]);

                twitterApi.apiConnection = mock.Object;

                await twitterApi.StatusesUserTimeline("twitterapi", count: 200, maxId: 900L, sinceId: 100L)
                    .ConfigureAwait(false);

                mock.VerifyAll();
            }
        }