ListsCreate() public méthode

public ListsCreate ( string name, string description = null, bool @private = null ) : Task>
name string
description string
@private bool
Résultat Task>
Exemple #1
0
        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();
            }
        }
Exemple #2
0
        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();
            }
        }