public bool Equals(ApiLimit obj) { return(obj != null && this.AccessLimitCount == obj.AccessLimitCount && this.AccessLimitRemain == obj.AccessLimitRemain && this.AccessLimitResetDate == obj.AccessLimitResetDate); }
public bool Equals(ApiLimit obj) { return obj != null && this.AccessLimitCount == obj.AccessLimitCount && this.AccessLimitRemain == obj.AccessLimitRemain && this.AccessLimitResetDate == obj.AccessLimitResetDate; }
private void AddListViewItem(string endpoint, ApiLimit apiLimit, ListViewGroup group) { var item = new ListViewItem( new string[] { endpoint, apiLimit.AccessLimitRemain + "/" + apiLimit.AccessLimitCount, apiLimit.AccessLimitResetDate.ToString() }); item.Group = group; this.ListViewApi.Items.Add(item); }
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; } }
public void EqualsTest(object obj2, bool expected) { var obj1 = new ApiLimit(150, 100, new DateTimeUtc(2013, 1, 1, 0, 0, 0)); Assert.Equal(expected, obj1.Equals(obj2)); }
public void Reset() { this.AccessLevel = TwitterApiAccessLevel.Anonymous; this.AccessLimit.Clear(); this.MediaUploadLimit = null; }
public void EqualsTest(object obj2, bool expect) { var obj1 = new ApiLimit(150, 100, new DateTime(2013, 1, 1, 0, 0, 0)); Assert.That(obj1.Equals(obj2), Is.EqualTo(expect)); }
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; }
public void UpdateFromApi(TwitterDataModel.RateLimitStatus limit) { if (limit == null) throw new ArgumentNullException(); this.AccessLimit = new ApiLimit(limit.HourlyLimit, limit.RemainingHits, MyCommon.DateTimeParse(limit.ResetTime)); var mediaLimit = limit.Photos; if (mediaLimit != null) { this.MediaUploadLimit = new ApiLimit(mediaLimit.DailyLimit, mediaLimit.RemainingHits, MyCommon.DateTimeParse(mediaLimit.ResetTime)); } }
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 ParseRateLimitTest(IDictionary <string, string> header, ApiLimit expect) { var limit = TwitterApiStatus.ParseRateLimit(header, "X-RateLimit-"); Assert.That(limit, Is.EqualTo(expect)); }
public void ParseRateLimitTest(IDictionary<string, string> header, ApiLimit expected) { var limit = TwitterApiStatus.ParseRateLimit(header, "X-RateLimit-"); Assert.Equal(expected, limit); }
public void ParseRateLimitTest(IDictionary <string, string> header, ApiLimit expected) { var limit = TwitterApiStatus.ParseRateLimit(header, "X-RateLimit-"); Assert.Equal(expected, limit); }
public void ParseRateLimitTest(IDictionary<string, string> header, ApiLimit expect) { var limit = TwitterApiStatus.ParseRateLimit(header); Assert.That(limit, Is.EqualTo(expect)); }
public void EqualsTest(object obj2, bool expected) { var obj1 = new ApiLimit(150, 100, new DateTime(2013, 1, 1, 0, 0, 0)); Assert.Equal(expected, obj1.Equals(obj2)); }