public ListsCreate ( string name, string description = null, bool @private = null ) : Task |
||
name | string | |
description | string | |
@private | bool | |
return | Task |
public async Task ListsCreate_Test() { using (var twitterApi = new TwitterApi()) { var mock = new Mock <IApiConnection>(); mock.Setup(x => x.PostLazyAsync <TwitterList>( new Uri("lists/create.json", UriKind.Relative), new Dictionary <string, string> { { "name", "hogehoge" }, { "description", "aaaa" }, { "mode", "private" }, }) ) .ReturnsAsync(LazyJson.Create(new TwitterList())); twitterApi.apiConnection = mock.Object; await twitterApi.ListsCreate("hogehoge", description : "aaaa", @private : true) .IgnoreResponse() .ConfigureAwait(false); mock.VerifyAll(); } }
public async Task ListsCreate_Test() { using (var twitterApi = new TwitterApi()) { var mock = new Mock<IApiConnection>(); mock.Setup(x => x.PostLazyAsync<TwitterList>( new Uri("lists/create.json", UriKind.Relative), new Dictionary<string, string> { { "name", "hogehoge" }, { "description", "aaaa" }, { "mode", "private" }, }) ) .ReturnsAsync(LazyJson.Create(new TwitterList())); twitterApi.apiConnection = mock.Object; await twitterApi.ListsCreate("hogehoge", description: "aaaa", @private: true) .IgnoreResponse() .ConfigureAwait(false); mock.VerifyAll(); } }