Пример #1
0
        public async void GetRandomArtistInfo2AsAdminUserOnSubsonic()
        {
            var artists = await _adminSubsonicClient.GetArtistsAsync();

            Assert.True(artists.Indexes.Any());

            var randomArtistIndexNumber = _random.Next(0, artists.Indexes.Count - 1);
            var randomArtistIndex       = artists.Indexes.ElementAt(randomArtistIndexNumber);

            Assert.True(randomArtistIndex.Artists.Any());

            var randomArtistNumber = _random.Next(0, randomArtistIndex.Artists.Count - 1);
            var randomArtist       = randomArtistIndex.Artists.ElementAt(randomArtistNumber);
            var artist             = await _adminSubsonicClient.GetArtistAsync(randomArtist.Id);

            Assert.True(!string.IsNullOrWhiteSpace(artist.Id));
            Assert.True(!string.IsNullOrWhiteSpace(artist.Name));

            var artistInfo2 = await _adminSubsonicClient.GetArtistInfo2Async(randomArtist.Id);

            Assert.NotNull(artistInfo2);

            if (!string.IsNullOrWhiteSpace(artistInfo2.LastFmUrl))
            {
                Assert.NotNull(artistInfo2.Biography);
            }

            Assert.NotNull(artistInfo2.MusicBrainzId);
            Assert.NotNull(artistInfo2.SmallImageUrl);
            Assert.NotNull(artistInfo2.MediumImageUrl);
            Assert.NotNull(artistInfo2.LargeImageUrl);
        }