Esempio n. 1
0
        public async Task GetCharacterAsync_CorrectId_ShouldReturnNotNullCharacter(long malId)
        {
            // When
            var returnedCharacter = await _jikan.GetCharacterAsync(malId);

            // Then
            returnedCharacter.Should().NotBeNull();
        }
Esempio n. 2
0
        public async Task <MalCharacterUpdateData> GetCharacterDataAsync(long malId)
        {
            var parsedData = await _jikanClient.GetCharacterAsync(malId);

            if (parsedData?.Data is null)
            {
                return(null);
            }

            return(new MalCharacterUpdateData(
                       parsedData.Data.Name,
                       parsedData.Data.About,
                       parsedData.Data.NameKanji,
                       EmptyStringIfPlaceholder(parsedData.Data.Images?.JPG?.ImageUrl),
                       (parsedData.Data.Nicknames != null && parsedData.Data.Nicknames.Any()) ? string.Join(';', parsedData.Data.Nicknames) : string.Empty,
                       parsedData.Data.Favorites
                       ));
        }