Exemple #1
0
        public void TestSpotifyAdapter_CheckIfPlaylistExists()
        {
            SpotifyAdapter spotify = new SpotifyAdapter(new SettingsFacade());
            bool           exists  = spotify.PlaylistExists("Podcasts");

            Assert.IsTrue(exists);
        }
Exemple #2
0
        public void TestSpotifyAdapter_BasicConnectivity()
        {
            SpotifyAdapter spotify = new SpotifyAdapter(new SettingsFacade());
            Task <User>    user    = spotify.GetCurrentUser();

            Assert.AreEqual("Simon Mazzucca", user.Result.DisplayName);
        }
Exemple #3
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);
        }