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; } }
public void ParseMediaRateLimitTest(IDictionary <string, string> header, ApiLimit expect) { var limit = TwitterApiStatus.ParseMediaRateLimit(header); Assert.That(limit, Is.EqualTo(expect)); }