BlocksIds() public method

public BlocksIds ( long cursor = null ) : Task
cursor long
return Task
Esempio n. 1
0
        public async Task BlocksIds_Test()
        {
            var mock = new Mock <IApiConnection>();

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

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

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

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

                twitterApi.apiConnection = mock.Object;

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

                mock.VerifyAll();
            }
        }