public AccountUpdateProfileImage ( IMediaItem image ) : Task |
||
image | IMediaItem | |
리턴 | Task |
public async Task AccountUpdateProfileImage_Test() { using (var twitterApi = new TwitterApi()) using (var image = TestUtils.CreateDummyImage()) using (var media = new MemoryImageMediaItem(image)) { var mock = new Mock <IApiConnection>(); mock.Setup(x => x.PostLazyAsync <TwitterUser>( new Uri("account/update_profile_image.json", UriKind.Relative), new Dictionary <string, string> { { "include_entities", "true" }, { "include_ext_alt_text", "true" }, { "tweet_mode", "extended" }, }, new Dictionary <string, IMediaItem> { { "image", media } }) ) .ReturnsAsync(LazyJson.Create(new TwitterUser())); twitterApi.apiConnection = mock.Object; await twitterApi.AccountUpdateProfileImage(media) .IgnoreResponse() .ConfigureAwait(false); mock.VerifyAll(); } }
public async Task AccountUpdateProfileImage_Test() { using (var twitterApi = new TwitterApi()) using (var image = TestUtils.CreateDummyImage()) using (var media = new MemoryImageMediaItem(image)) { var mock = new Mock<IApiConnection>(); mock.Setup(x => x.PostLazyAsync<TwitterUser>( new Uri("account/update_profile_image.json", UriKind.Relative), new Dictionary<string, string> { { "include_entities", "true" }, { "include_ext_alt_text", "true" }, { "tweet_mode", "extended" }, }, new Dictionary<string, IMediaItem> { { "image", media } }) ) .ReturnsAsync(LazyJson.Create(new TwitterUser())); twitterApi.apiConnection = mock.Object; await twitterApi.AccountUpdateProfileImage(media) .IgnoreResponse() .ConfigureAwait(false); mock.VerifyAll(); } }