AccountUpdateProfile() public method

public AccountUpdateProfile ( string name, string url, string location, string description ) : Task>
name string
url string
location string
description string
return Task>
Esempio n. 1
0
        public async Task AccountUpdateProfile_Test()
        {
            using (var twitterApi = new TwitterApi())
            {
                var mock = new Mock <IApiConnection>();
                mock.Setup(x =>
                           x.PostLazyAsync <TwitterUser>(
                               new Uri("account/update_profile.json", UriKind.Relative),
                               new Dictionary <string, string> {
                    { "include_entities", "true" },
                    { "include_ext_alt_text", "true" },
                    { "tweet_mode", "extended" },
                    { "name", "Name" },
                    { "url", "http://example.com/" },
                    { "location", "Location" },
                    { "description", "&lt;script&gt;alert(1)&lt;/script&gt;" },
                })
                           )
                .ReturnsAsync(LazyJson.Create(new TwitterUser()));

                twitterApi.apiConnection = mock.Object;

                await twitterApi.AccountUpdateProfile(name : "Name", url : "http://example.com/", location : "Location", description : "<script>alert(1)</script>")
                .IgnoreResponse()
                .ConfigureAwait(false);

                mock.VerifyAll();
            }
        }
Esempio n. 2
0
        public async Task AccountUpdateProfile_Test()
        {
            using (var twitterApi = new TwitterApi())
            {
                var mock = new Mock<IApiConnection>();
                mock.Setup(x =>
                    x.PostLazyAsync<TwitterUser>(
                        new Uri("account/update_profile.json", UriKind.Relative),
                        new Dictionary<string, string> {
                            { "include_entities", "true" },
                            { "include_ext_alt_text", "true" },
                            { "tweet_mode", "extended" },
                            { "name", "Name" },
                            { "url", "http://example.com/" },
                            { "location", "Location" },
                            { "description", "&lt;script&gt;alert(1)&lt;/script&gt;" },
                        })
                )
                .ReturnsAsync(LazyJson.Create(new TwitterUser()));

                twitterApi.apiConnection = mock.Object;

                await twitterApi.AccountUpdateProfile(name: "Name", url: "http://example.com/", location: "Location", description: "<script>alert(1)</script>")
                    .IgnoreResponse()
                    .ConfigureAwait(false);

                mock.VerifyAll();
            }
        }