ListsMembersDestroy() public method

public ListsMembersDestroy ( long listId, string screenName ) : Task>
listId long
screenName string
return Task>
示例#1
0
        public async Task ListsMembersDestroy_Test()
        {
            using (var twitterApi = new TwitterApi())
            {
                var mock = new Mock <IApiConnection>();
                mock.Setup(x =>
                           x.PostLazyAsync <TwitterUser>(
                               new Uri("lists/members/destroy.json", UriKind.Relative),
                               new Dictionary <string, string> {
                    { "list_id", "12345" },
                    { "screen_name", "twitterapi" },
                    { "include_entities", "true" },
                    { "include_ext_alt_text", "true" },
                    { "tweet_mode", "extended" },
                })
                           )
                .ReturnsAsync(LazyJson.Create(new TwitterUser()));

                twitterApi.apiConnection = mock.Object;

                await twitterApi.ListsMembersDestroy(12345L, "twitterapi")
                .IgnoreResponse()
                .ConfigureAwait(false);

                mock.VerifyAll();
            }
        }
示例#2
0
        public async Task ListsMembersDestroy_Test()
        {
            using (var twitterApi = new TwitterApi())
            {
                var mock = new Mock<IApiConnection>();
                mock.Setup(x =>
                    x.PostLazyAsync<TwitterUser>(
                        new Uri("lists/members/destroy.json", UriKind.Relative),
                        new Dictionary<string, string> {
                            { "list_id", "12345" },
                            { "screen_name", "twitterapi" },
                            { "include_entities", "true" },
                            { "include_ext_alt_text", "true" },
                            { "tweet_mode", "extended" },
                        })
                )
                .ReturnsAsync(LazyJson.Create(new TwitterUser()));

                twitterApi.apiConnection = mock.Object;

                await twitterApi.ListsMembersDestroy(12345L, "twitterapi")
                    .IgnoreResponse()
                    .ConfigureAwait(false);

                mock.VerifyAll();
            }
        }