Пример #1
0
        public async Task GetAnime_CorrectId_ShouldParseBaseJikanRequest()
        {
            // When
            BaseJikanRequest request = await _jikan.GetAnime(1);

            // Then
            request.Should().NotBeNull();
        }
Пример #2
0
        public async Task GetAnime_CorrectId_ShouldParseCacheExpiration()
        {
            // When
            // Random id
            int randomId             = DateTime.Now.Second * DateTime.Now.Minute;
            BaseJikanRequest request = await _jikan.GetAnime(randomId);

            // Then
            request.Should().NotBeNull();

            if (!request.RequestCached)
            {
                request.RequestCacheExpiry.Should().Be(86400);
            }
            else
            {
                request.RequestCacheExpiry.Should().BeLessThan(86400);
            }
        }