public void NumberOfSongsInPlayListShouldReturnOne(string title) { musicPlayer = new MusicPlayer(mediaDb, soundMaker); int songsInQueue = musicPlayer.NumSongsInQueue; mediaDb.OpenConnection(); musicPlayer.LoadSongs("Disturbed"); mediaDb.CloseConnection(); int presentSongsInQueue = musicPlayer.NumSongsInQueue; Assert.That(presentSongsInQueue == 3, "Inga sånger lades till"); }
public void LoadSongs(string search) { if (string.IsNullOrWhiteSpace(search)) { throw new NullReferenceException(); } mediaDatabase.OpenConnection(); List <ISong> fetchedSongs = mediaDatabase.FetchSongs(search); SongsInQueue.AddRange(fetchedSongs); mediaDatabase.CloseConnection(); }
public void LoadSongsShouldReturnOneSong(string nothing) { IMusicPlayer player = new MusicPlayer(mediaDb, soundDb); int songsInQueBefore = player.NumSongsInQueue; mediaDb.OpenConnection(); player.LoadSongs(nothing); mediaDb.CloseConnection(); int songInQueAfter = player.NumSongsInQueue;; Assert.That(songsInQueBefore < songInQueAfter, "Inga låtar lades till"); }