public AccountUpdateProfile ( string name, string url, string location, string description ) : Task |
||
name | string | |
url | string | |
location | string | |
description | string | |
return | Task |
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", "<script>alert(1)</script>" }, }) ) .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(); } }
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", "<script>alert(1)</script>" }, }) ) .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(); } }