Ejemplo n.º 1
0
            public void ShouldNotThrowIfHeaderNotPresent(
                Bucket bucket,
                [Target] DefaultBucketService service
                )
            {
                var response = new HttpResponseMessage();

                Action func = () => service.UpdateBucketHitsRemaining(bucket, response);

                func.Should().NotThrow();
            }
Ejemplo n.º 2
0
            public void ShouldNotThrowIfHeaderValueIsNotANumber(
                Bucket bucket,
                [Target] DefaultBucketService service
                )
            {
                var response = new HttpResponseMessage();

                response.Headers.Add("x-ratelimit-remaining", new[] { "asdf" });

                Action func = () => service.UpdateBucketHitsRemaining(bucket, response);

                func.Should().NotThrow();
            }
Ejemplo n.º 3
0
            public void ShouldUpdateHitsRemaining(
                Bucket bucket,
                [Target] DefaultBucketService service
                )
            {
                var response = new HttpResponseMessage();

                response.Headers.Add("x-ratelimit-remaining", new[] { "12" });

                service.UpdateBucketHitsRemaining(bucket, response);

                bucket.HitsRemaining.Should().Be(12);
            }