Пример #1
0
        public async void GetMusicDirectoryForRandomMusicFolderAndRandomIndexAsAdminUserOnSubsonic()
        {
            var musicFolders = await _adminSubsonicClient.GetMusicFoldersAsync();

            Assert.True(musicFolders.Items.Any());

            var randomMusicFolderNumber = _random.Next(0, musicFolders.Items.Count - 1);
            var randomMusicFolder       = musicFolders.Items.ElementAt(randomMusicFolderNumber);
            var indexes = await _adminSubsonicClient.GetIndexesAsync(randomMusicFolder.Id);

            Assert.True(indexes.Items.Any());

            var randomIndexNumber  = _random.Next(0, indexes.Items.Count - 1);
            var randomIndex        = indexes.Items.ElementAt(randomIndexNumber);
            var randomArtistNumber = _random.Next(0, randomIndex.Artists.Count - 1);
            var randomArtist       = randomIndex.Artists.ElementAt(randomArtistNumber);
            var musicDirectory     = await _adminSubsonicClient.GetMusicDirectoryAsync(randomArtist.Id);

            Assert.True(!string.IsNullOrWhiteSpace(musicDirectory.Id));
            Assert.True(!string.IsNullOrWhiteSpace(musicDirectory.Name));
            Assert.True(musicDirectory.Children.Any());
        }
Пример #2
0
 public Func <CancellationToken?, Task <Directory> > CreateMethod(ISubsonicClient <TImageType> subsonicClient)
 {
     return(cancelToken => subsonicClient.GetMusicDirectoryAsync(Id, cancelToken));
 }