DirectMessagesNew() public méthode

public DirectMessagesNew ( string status, string sendTo ) : Task>
status string
sendTo string
Résultat Task>
Exemple #1
0
        public async Task DirectMessagesNew_Test()
        {
            using (var twitterApi = new TwitterApi())
            {
                var mock = new Mock <IApiConnection>();
                mock.Setup(x =>
                           x.PostLazyAsync <TwitterDirectMessage>(
                               new Uri("direct_messages/new.json", UriKind.Relative),
                               new Dictionary <string, string> {
                    { "text", "hogehoge" },
                    { "screen_name", "opentween" },
                })
                           )
                .ReturnsAsync(LazyJson.Create(new TwitterDirectMessage()));

                twitterApi.apiConnection = mock.Object;

                await twitterApi.DirectMessagesNew("hogehoge", "opentween")
                .IgnoreResponse()
                .ConfigureAwait(false);

                mock.VerifyAll();
            }
        }
Exemple #2
0
        public async Task DirectMessagesNew_Test()
        {
            using (var twitterApi = new TwitterApi())
            {
                var mock = new Mock<IApiConnection>();
                mock.Setup(x =>
                    x.PostLazyAsync<TwitterDirectMessage>(
                        new Uri("direct_messages/new.json", UriKind.Relative),
                        new Dictionary<string, string> {
                            { "text", "hogehoge" },
                            { "screen_name", "opentween" },
                        })
                )
                .ReturnsAsync(LazyJson.Create(new TwitterDirectMessage()));

                twitterApi.apiConnection = mock.Object;

                await twitterApi.DirectMessagesNew("hogehoge", "opentween")
                    .IgnoreResponse()
                    .ConfigureAwait(false);

                mock.VerifyAll();
            }
        }