DirectMessagesSent() public méthode

public DirectMessagesSent ( int count = null, long maxId = null, long sinceId = null ) : Task
count int
maxId long
sinceId long
Résultat Task
Exemple #1
0
        public async Task DirectMessagesSent_Test()
        {
            using (var twitterApi = new TwitterApi())
            {
                var mock = new Mock <IApiConnection>();
                mock.Setup(x =>
                           x.GetAsync <TwitterDirectMessage[]>(
                               new Uri("direct_messages/sent.json", UriKind.Relative),
                               new Dictionary <string, string> {
                    { "full_text", "true" },
                    { "include_entities", "true" },
                    { "include_ext_alt_text", "true" },
                    { "count", "200" },
                    { "max_id", "900" },
                    { "since_id", "100" },
                },
                               "/direct_messages/sent")
                           )
                .ReturnsAsync(new TwitterDirectMessage[0]);

                twitterApi.apiConnection = mock.Object;

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

                mock.VerifyAll();
            }
        }
Exemple #2
0
        public async Task DirectMessagesSent_Test()
        {
            using (var twitterApi = new TwitterApi())
            {
                var mock = new Mock<IApiConnection>();
                mock.Setup(x =>
                    x.GetAsync<TwitterDirectMessage[]>(
                        new Uri("direct_messages/sent.json", UriKind.Relative),
                        new Dictionary<string, string> {
                            { "full_text", "true" },
                            { "include_entities", "true" },
                            { "include_ext_alt_text", "true" },
                            { "count", "200" },
                            { "max_id", "900" },
                            { "since_id", "100" },
                        },
                        "/direct_messages/sent")
                )
                .ReturnsAsync(new TwitterDirectMessage[0]);

                twitterApi.apiConnection = mock.Object;

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

                mock.VerifyAll();
            }
        }