public RateLimitCacheManager(
     ICredentialsAccessor credentialsAccessor,
     ITwitterRequester twitterRequester,
     IHelpQueryGenerator helpQueryGenerator,
     IJsonObjectConverter jsonObjectConverter,
     IRateLimitCache rateLimitCache,
     IRateLimitHelper rateLimitHelper,
     ITwitterQueryFactory twitterQueryFactory)
 {
     _credentialsAccessor = credentialsAccessor;
     _twitterRequester = twitterRequester;
     _helpQueryGenerator = helpQueryGenerator;
     _jsonObjectConverter = jsonObjectConverter;
     _rateLimitCache = rateLimitCache;
     _rateLimitHelper = rateLimitHelper;
     _twitterQueryFactory = twitterQueryFactory;
 }
        private void GetTokenRateLimitFromQuery_EndpointAssociatedCorrectly(Expression<Func<ITokenRateLimits, ITokenRateLimit>> rateLimit, string associatedURL, IRateLimitHelper rateLimitHelper)
        {
            // Arrange
            var fakeTokenRateLimit = A.Fake<ITokenRateLimit>();
            _tokenRateLimits.CallsTo(rateLimit).Returns(fakeTokenRateLimit);

            // Act
            var tokenRateLimit = rateLimitHelper.GetTokenRateLimitFromQuery(associatedURL, _tokenRateLimits);

            // Assert
            Assert.AreEqual(tokenRateLimit, fakeTokenRateLimit);
        }
示例#3
0
        private void GetTokenRateLimitFromQuery_EndpointAssociatedCorrectly(Expression <Func <ICredentialsRateLimits, IEndpointRateLimit> > rateLimit, string associatedURL, IRateLimitHelper rateLimitHelper)
        {
            // Arrange
            var fakeTokenRateLimit = A.Fake <IEndpointRateLimit>();

            _credentialsRateLimits.CallsTo(rateLimit).Returns(fakeTokenRateLimit);

            // Act
            var tokenRateLimit = rateLimitHelper.GetEndpointRateLimitFromQuery(associatedURL, _credentialsRateLimits);

            // Assert
            Assert.AreEqual(tokenRateLimit, fakeTokenRateLimit);
        }