FollowersIds() public méthode

public FollowersIds ( long cursor = null ) : Task
cursor long
Résultat Task
        public async Task FollowersIds_Test()
        {
            var mock = new Mock <IApiConnection>();

            mock.Setup(x =>
                       x.GetAsync <TwitterIds>(
                           new Uri("followers/ids.json", UriKind.Relative),
                           new Dictionary <string, string> {
                { "cursor", "-1" }
            },
                           "/followers/ids")
                       )
            .ReturnsAsync(new TwitterIds());

            using var twitterApi     = new TwitterApi();
            twitterApi.apiConnection = mock.Object;

            await twitterApi.FollowersIds(cursor : -1L)
            .ConfigureAwait(false);

            mock.VerifyAll();
        }
Exemple #2
0
        public async Task FollowersIds_Test()
        {
            using (var twitterApi = new TwitterApi())
            {
                var mock = new Mock<IApiConnection>();
                mock.Setup(x =>
                    x.GetAsync<TwitterIds>(
                        new Uri("followers/ids.json", UriKind.Relative),
                        new Dictionary<string, string> { { "cursor", "-1" } },
                        "/followers/ids")
                )
                .ReturnsAsync(new TwitterIds());

                twitterApi.apiConnection = mock.Object;

                await twitterApi.FollowersIds(cursor: -1L)
                    .ConfigureAwait(false);

                mock.VerifyAll();
            }
        }