Beispiel #1
0
        public async Task GetManga_CorrectId_ShouldReturnNotNullManga(long malId)
        {
            // When
            var returedManga = await _jikan.GetManga(malId);

            // Then
            returedManga.Should().NotBeNull();
        }
Beispiel #2
0
        public void ShouldUseIMalEntityInterface()
        {
            IMalEntity berserk = Task.Run(() => jikan.GetManga(2)).Result;
            IMalEntity bebop   = Task.Run(() => jikan.GetAnime(1)).Result;

            List <IMalEntity> entities = new List <IMalEntity>();

            entities.Add(berserk);
            entities.Add(bebop);

            Assert.Contains(1, entities.Select(x => x.MalId));
        }
Beispiel #3
0
        public async Task GetAnimeGetManga_CorrectId_ShouldUseIMalEntityInterface()
        {
            IMalEntity berserk = await jikan.GetManga(2);

            IMalEntity bebop = await jikan.GetAnime(1);

            List <IMalEntity> entities = new List <IMalEntity>();

            entities.Add(berserk);
            entities.Add(bebop);

            Assert.Contains(1, entities.Select(x => x.MalId));
        }
Beispiel #4
0
        public async Task GetAnimeGetManga_CorrectId_ShouldUseIMalEntityInterface()
        {
            // Given
            IMalEntity berserk = await _jikan.GetManga(2);

            IMalEntity bebop = await _jikan.GetAnime(1);

            List <IMalEntity> entities = new List <IMalEntity>
            {
                berserk,
                bebop
            };

            // When
            var ids = entities.Select(x => x.MalId);

            // Then
            ids.Should().Contain(1);
        }
Beispiel #5
0
        public async Task GetManga_CorrectId_ShouldReturnNotNullManga(long malId)
        {
            Manga returedManga = await jikan.GetManga(malId);

            Assert.NotNull(returedManga);
        }
Beispiel #6
0
 public void GetManga_WrongIdDoNotSurpressExceptions_ShouldThrowJikanRequestExceptionGetManga()
 {
     Assert.ThrowsAnyAsync <JikanRequestException>(() => jikan.GetManga(5));
 }
Beispiel #7
0
 public void ShouldThrowJikanRequestExceptionGetManga()
 {
     Assert.ThrowsAnyAsync <JikanRequestException>(() => jikan.GetManga(5));
 }
Beispiel #8
0
        public void ShouldReturnNotNullManga(long malId)
        {
            Manga returedManga = Task.Run(() => jikan.GetManga(malId)).Result;

            Assert.NotNull(returedManga);
        }