ParseRateLimit() 정적인 개인적인 메소드

static private ParseRateLimit ( string>.IDictionary header, string prefix ) : OpenTween.Api.ApiLimit
header string>.IDictionary
prefix string
리턴 OpenTween.Api.ApiLimit
예제 #1
0
        public void UpdateFromHeader(IDictionary <string, string> header, string endpointName)
        {
            var rateLimit = TwitterApiStatus.ParseRateLimit(header, "X-Rate-Limit-");

            if (rateLimit != null)
            {
                this.AccessLimit[endpointName] = rateLimit;
            }

            var mediaLimit = TwitterApiStatus.ParseRateLimit(header, "X-MediaRateLimit-");

            if (mediaLimit != null)
            {
                this.MediaUploadLimit = mediaLimit;
            }

            var accessLevel = TwitterApiStatus.ParseAccessLevel(header, "X-Access-Level");

            if (accessLevel.HasValue)
            {
                this.AccessLevel = accessLevel.Value;
            }
        }
예제 #2
0
        public void UpdateFromHeader(IDictionary <string, string> header)
        {
            var rateLimit = TwitterApiStatus.ParseRateLimit(header);

            if (rateLimit != null)
            {
                this.AccessLimit = rateLimit;
            }

            var mediaLimit = TwitterApiStatus.ParseMediaRateLimit(header);

            if (mediaLimit != null)
            {
                this.MediaUploadLimit = mediaLimit;
            }

            var accessLevel = TwitterApiStatus.ParseAccessLevel(header);

            if (accessLevel.HasValue)
            {
                this.AccessLevel = accessLevel.Value;
            }
        }
예제 #3
0
        public void ParseRateLimitTest(IDictionary <string, string> header, ApiLimit expected)
        {
            var limit = TwitterApiStatus.ParseRateLimit(header, "X-RateLimit-");

            Assert.Equal(expected, limit);
        }
예제 #4
0
        public void ParseRateLimitTest(IDictionary <string, string> header, ApiLimit expect)
        {
            var limit = TwitterApiStatus.ParseRateLimit(header, "X-RateLimit-");

            Assert.That(limit, Is.EqualTo(expect));
        }