RateLimit class encapsulates rate limit headers

Added a RateLimit class to encapsulate pulling rate limit information
from the headers. This is now exposed by ApiInfo as well as the
RateLimitExceeededException. That way these two classes are not grabbing
the same information in different ways which we were doing before.
This commit is contained in:
Haacked
2013-10-18 14:49:00 -07:00
parent c44e5e5464
commit 14ad942ea8
16 changed files with 281 additions and 99 deletions
@@ -23,7 +23,7 @@ namespace Octokit.Tests.Models
var response = new ApiResponse<List<object>>
{
BodyAsObject = new List<object>(),
ApiInfo = new ApiInfo(links, scopes, scopes, "etag", 100, 100)
ApiInfo = new ApiInfo(links, scopes, scopes, "etag", new RateLimit(new Dictionary<string, string>()))
};
var connection = Substitute.For<IConnection>();
connection.GetAsync<List<object>>(nextPageUrl, null, null).Returns(nextPageResponse);