UsersShow() public méthode

public UsersShow ( string screenName ) : Task
screenName string
Résultat Task
Exemple #1
0
        public async Task UsersShow_Test()
        {
            using (var twitterApi = new TwitterApi())
            {
                var mock = new Mock <IApiConnection>();
                mock.Setup(x =>
                           x.GetAsync <TwitterUser>(
                               new Uri("users/show.json", UriKind.Relative),
                               new Dictionary <string, string> {
                    { "screen_name", "twitterapi" },
                    { "include_entities", "true" },
                    { "include_ext_alt_text", "true" },
                    { "tweet_mode", "extended" },
                },
                               "/users/show/:id")
                           )
                .ReturnsAsync(new TwitterUser {
                    ScreenName = "twitterapi"
                });

                twitterApi.apiConnection = mock.Object;

                await twitterApi.UsersShow(screenName : "twitterapi")
                .ConfigureAwait(false);

                mock.VerifyAll();
            }
        }
Exemple #2
0
        public async Task UsersShow_Test()
        {
            using (var twitterApi = new TwitterApi())
            {
                var mock = new Mock<IApiConnection>();
                mock.Setup(x =>
                    x.GetAsync<TwitterUser>(
                        new Uri("users/show.json", UriKind.Relative),
                        new Dictionary<string, string> {
                            { "screen_name", "twitterapi" },
                            { "include_entities", "true" },
                            { "include_ext_alt_text", "true" },
                            { "tweet_mode", "extended" },
                        },
                        "/users/show/:id")
                )
                .ReturnsAsync(new TwitterUser { ScreenName = "twitterapi" });

                twitterApi.apiConnection = mock.Object;

                await twitterApi.UsersShow(screenName: "twitterapi")
                    .ConfigureAwait(false);

                mock.VerifyAll();
            }
        }