ParseAccessLevel() static private method

static private ParseAccessLevel ( string>.IDictionary header, string headerName ) : TwitterApiAccessLevel?
header string>.IDictionary
headerName string
return TwitterApiAccessLevel?
Ejemplo n.º 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;
            }
        }
Ejemplo n.º 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;
            }
        }
Ejemplo n.º 3
0
        public void ParseAccessLevelTest(IDictionary <string, string> header, TwitterApiAccessLevel?expected)
        {
            var accessLevel = TwitterApiStatus.ParseAccessLevel(header, "X-Access-Level");

            Assert.Equal(expected, accessLevel);
        }
Ejemplo n.º 4
0
        public void ParseAccessLevelTest(IDictionary <string, string> header, TwitterApiAccessLevel?expect)
        {
            var accessLevel = TwitterApiStatus.ParseAccessLevel(header, "X-Access-Level");

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