Ejemplo n.º 1
0
        public List <SongsType> GetAllSongs()
        {
            var songs = playlist.GetAll();

            var songTypeList = new List <SongsType>();

            songs.ForEach(it => songTypeList.Add(new SongsType(it.Title, it.Artist, it.Genres)));

            return(songTypeList);
        }
        public void GetAllSongs()
        {
            var savedSongId  = musicPlaylist.Add(_registerSongRequest);
            var possibleSong = musicPlaylist.GetById(savedSongId);

            var allSongs = musicPlaylist.GetAll();

            Assert.IsTrue(allSongs.SequenceEqual(new List <Song>()
            {
                possibleSong.Value
            }));
        }
 /// <summary>
 /// Retrieves all registered songs.
 /// </summary>
 /// <returns>A list of all registered songs.</returns>
 public List <Song> GetAllSongs()
 {
     try
     {
         return(playlist.GetAll());
     }
     catch (Exception e)
     {
         logger.Error(e.ToString());
         System.Diagnostics.Trace.Write(e.ToString());
         return(new List <Song>());
     }
 }
        public HttpResponseMessage GetAllSongs()
        {
            logger.Info("Retrieving all songs");

            return(this.Request.CreateResponse(HttpStatusCode.OK, playlist.GetAll()));
        }