Ejemplo n.º 1
0
        public void AddSongToPlaylist()
        {
            playListController.AddPlayList("geschwindigkeitsbegrenzung", 1);
            PlayList playList = playListController.FindPlayListsByName("geschwindigkeitsbegrenzung")[0];

            songController.AddSong("YWo4qBnSwjM", 1);
            Song song = songController.GetSongByUrl("YWo4qBnSwjM");

            playListController.AddSongToPlayList("YWo4qBnSwjM", playList.ActivityId.ToString(), 1);

            Assert.AreEqual(song.Url, playListController.GetSongsFromPlayList(playList.ActivityId.ToString())[0].Url);
            dbActivity.DeleteActivity(1, playList.ActivityId, null, new DbConnection().GetConnection());
            dbActivity.DeleteActivity(1, song.ActivityId, null, new DbConnection().GetConnection());
        }
Ejemplo n.º 2
0
        public void FindSongByNameExisting()
        {
            string name = "Idiot Test";

            songController.AddSong("YWo4qBnSwjM", 1);
            songController.AddSong("2a4Uxdy9TQY", 1);
            List <string> urlsActual   = new List <string>();
            List <string> urlsExpected = new List <string>();

            urlsExpected.Add("YWo4qBnSwjM");
            urlsExpected.Add("2a4Uxdy9TQY");

            List <Song> songs = songController.FindSongsByName(name);

            foreach (Song song in songs)
            {
                urlsActual.Add(song.Url);
            }
            CollectionAssert.AreEqual(urlsExpected, urlsActual);
            dbActivity.DeleteActivity(1, dbSong.FindSongByURL("YWo4qBnSwjM", null, new DbConnection().GetConnection()).ActivityId, null, new DbConnection().GetConnection());
            dbActivity.DeleteActivity(1, dbSong.FindSongByURL("2a4Uxdy9TQY", null, new DbConnection().GetConnection()).ActivityId, null, new DbConnection().GetConnection());
        }