public async Task GetCharacterAsync_CorrectId_ShouldReturnNotNullCharacter(long malId) { // When var returnedCharacter = await _jikan.GetCharacterAsync(malId); // Then returnedCharacter.Should().NotBeNull(); }
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 )); }