public void HandlesMissingHeaderValues()
            {
                var headers = new Dictionary <string, string>();

                var fairUsageLimit = new FairUsageLimit(headers);

                Assert.Null(fairUsageLimit.DailyRequestsLeft);
            }
            public void CanClone()
            {
                var original = new FairUsageLimit(981);

                var clone = original.Clone();

                Assert.NotSame(original, clone);
                Assert.Equal(original.DailyRequestsLeft, clone.DailyRequestsLeft);
            }
            public void HandlesInvalidHeaderValues()
            {
                var headers = new Dictionary <string, string>
                {
                    { "x-daily-requests-left", "garbage" }
                };

                var fairUsageLimit = new FairUsageLimit(headers);

                Assert.Null(fairUsageLimit.DailyRequestsLeft);
            }
            public void ParsesFairUsageLimitsFromHeaders()
            {
                var headers = new Dictionary <string, string>
                {
                    { "x-daily-requests-left", "981" }
                };

                var fairUsageLimit = new FairUsageLimit(headers);

                Assert.Equal(981, fairUsageLimit.DailyRequestsLeft);
            }