public void ParseBasicPlaylistCreatedManually()
        {
            string playlistFile = GetFullPath("Basic_Playlist.txt");

            CsvPlaylistRepo repo     = new CsvPlaylistRepo();
            Playlist        songList = repo.GetSongList(playlistFile);

            Assert.AreEqual(3, songList.Songs.Count);
        }
Esempio n. 2
0
        public void TestSpotifyAdapter_CreatePlaylistFromCsvFileAsync()
        {
            string          playlistFile  = GetFullPath("Basic_Playlist.txt");
            CsvPlaylistRepo repo          = new CsvPlaylistRepo();
            Playlist        songsToImport = repo.GetSongList(playlistFile);

            SpotifyAdapter  spotify  = new SpotifyAdapter(new SettingsFacade());
            SpotifyPlaylist playlist = spotify.GetPlaylist(PLAYLIST_TO_CREATE);

            if (playlist == null)
            {
                playlist = spotify.CreatePlaylist(PLAYLIST_TO_CREATE, false).Result;
                Assert.AreEqual(PLAYLIST_TO_CREATE, playlist.name);
            }

            spotify.AddSongsToPlaylist(playlist, songsToImport.Songs);

            SpotifyPlaylist playlistNew = spotify.GetPlaylist(PLAYLIST_TO_CREATE);

            Assert.IsNotNull(playlistNew);
            Assert.IsNotNull(playlistNew.tracks);
            Assert.AreEqual(songsToImport.Songs.Count, playlistNew.tracks.total);
        }