DirectMessagesDestroy() public method

public DirectMessagesDestroy ( long statusId ) : Task>
statusId long
return Task>
Example #1
0
        public async Task DirectMessagesDestroy_Test()
        {
            using (var twitterApi = new TwitterApi())
            {
                var mock = new Mock <IApiConnection>();
                mock.Setup(x =>
                           x.PostLazyAsync <TwitterDirectMessage>(
                               new Uri("direct_messages/destroy.json", UriKind.Relative),
                               new Dictionary <string, string> {
                    { "id", "100" }
                })
                           )
                .ReturnsAsync(LazyJson.Create(new TwitterDirectMessage {
                    Id = 100L
                }));

                twitterApi.apiConnection = mock.Object;

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

                mock.VerifyAll();
            }
        }
Example #2
0
        public async Task DirectMessagesDestroy_Test()
        {
            using (var twitterApi = new TwitterApi())
            {
                var mock = new Mock<IApiConnection>();
                mock.Setup(x =>
                    x.PostLazyAsync<TwitterDirectMessage>(
                        new Uri("direct_messages/destroy.json", UriKind.Relative),
                        new Dictionary<string, string> { { "id", "100" } })
                )
                .ReturnsAsync(LazyJson.Create(new TwitterDirectMessage { Id = 100L }));

                twitterApi.apiConnection = mock.Object;

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

                mock.VerifyAll();
            }
        }