예제 #1
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;
            }
        }
예제 #2
0
        public void ParseMediaRateLimitTest(IDictionary <string, string> header, ApiLimit expect)
        {
            var limit = TwitterApiStatus.ParseMediaRateLimit(header);

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