ApplicationRateLimitStatus() public method

public ApplicationRateLimitStatus ( ) : Task
return Task
Ejemplo n.º 1
0
        public async Task ApplicationRateLimitStatus_Test()
        {
            var mock = new Mock <IApiConnection>();

            mock.Setup(x =>
                       x.GetAsync <TwitterRateLimits>(
                           new Uri("application/rate_limit_status.json", UriKind.Relative),
                           null,
                           "/application/rate_limit_status")
                       )
            .ReturnsAsync(new TwitterRateLimits());

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

            await twitterApi.ApplicationRateLimitStatus()
            .ConfigureAwait(false);

            mock.VerifyAll();
        }
Ejemplo n.º 2
0
        public async Task ApplicationRateLimitStatus_Test()
        {
            using (var twitterApi = new TwitterApi())
            {
                var mock = new Mock<IApiConnection>();
                mock.Setup(x =>
                    x.GetAsync<TwitterRateLimits>(
                        new Uri("application/rate_limit_status.json", UriKind.Relative),
                        null,
                        "/application/rate_limit_status")
                )
                .ReturnsAsync(new TwitterRateLimits());

                twitterApi.apiConnection = mock.Object;

                await twitterApi.ApplicationRateLimitStatus()
                    .ConfigureAwait(false);

                mock.VerifyAll();
            }
        }