DirectMessagesRecv() public méthode

public DirectMessagesRecv ( 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 DirectMessagesRecv_Test()
        {
            using (var twitterApi = new TwitterApi())
            {
                var mock = new Mock <IApiConnection>();
                mock.Setup(x =>
                           x.GetAsync <TwitterDirectMessage[]>(
                               new Uri("direct_messages.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")
                           )
                .ReturnsAsync(new TwitterDirectMessage[0]);

                twitterApi.apiConnection = mock.Object;

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

                mock.VerifyAll();
            }
        }
Exemple #2
0
        public async Task DirectMessagesRecv_Test()
        {
            using (var twitterApi = new TwitterApi())
            {
                var mock = new Mock<IApiConnection>();
                mock.Setup(x =>
                    x.GetAsync<TwitterDirectMessage[]>(
                        new Uri("direct_messages.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")
                )
                .ReturnsAsync(new TwitterDirectMessage[0]);

                twitterApi.apiConnection = mock.Object;

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

                mock.VerifyAll();
            }
        }