Beispiel #1
0
        public void IfNoSongIsPlayingStartNext(string search)
        {
            musicPlayer = new MusicPlayer(mediaDb, soundMaker);
            mediaDb.OpenConnection();
            musicPlayer.LoadSongs("Disturbed");
            mediaDb.CloseConnection();

            int    presentSongsInQueue = musicPlayer.NumSongsInQueue;
            string newActual           = "";

            StringAssert.Contains("Tystnad Råder", musicPlayer.NowPlaying(), "Det spelades visst en låt!");
            musicPlayer.Play();
            newActual = musicPlayer.NowPlaying();
            //}
            Assert.Greater(presentSongsInQueue, 0, "No more songs in Playlist");
        }
Beispiel #2
0
        public void NowPlayingShouldBeSilence(string title)
        {
            musicPlayer = new MusicPlayer(mediaDb, soundMaker);
            musicPlayer.Stop();
            string actual = musicPlayer.NowPlaying();

            Assert.AreEqual(defaultSong, actual, "Tystnad Råder?");
        }
Beispiel #3
0
        public void NowPlayingShouldBeSilent()
        {
            player = new MusicPlayer(mediaDb, soundDb);

            string actual = player.NowPlaying();

            Assert.AreEqual(defaultSong, actual, "Tystnad råder tydligen inte");
        }
Beispiel #4
0
        public void StopThePlayingOfSongButKeepSongList(string search)
        {
            musicPlayer = new MusicPlayer(mediaDb, soundMaker);
            mediaDb.OpenConnection();
            musicPlayer.LoadSongs("Mustasch");
            mediaDb.CloseConnection();

            int presentSongsInQueue = musicPlayer.NumSongsInQueue;

            musicPlayer.Play();
            string actual = musicPlayer.NowPlaying();

            musicPlayer.Stop();
            Assert.AreNotEqual(defaultSong, actual, "Tystnad ska inte råda");

            string newActual = musicPlayer.NowPlaying();

            //}
            Assert.Greater(presentSongsInQueue, 0, "No more songs in Playlist");
        }
Beispiel #5
0
        public void NowPlayingShouldNotChangeIfSongIsAlreadyPlaying(string songTitle1, string songTitle2)
        {
            player = new MusicPlayer(mediaDb, soundDb);
            mediaDb.OpenConnection();
            player.LoadSongs(songTitle1);
            player.LoadSongs(songTitle2);
            mediaDb.CloseConnection();

            // Spelar Stairway to heaven
            player.Play();

            var playing = player.NowPlaying();

            StringAssert.Contains(songTitle1, player.NowPlaying(), "Den borde ju spelas");


            player.Play();

            playing = player.NowPlaying();

            StringAssert.Contains(songTitle1, player.NowPlaying(), "Den borde ju spelas");

            player.Stop();
        }
Beispiel #6
0
        public void NowPlayingShouldBeCurrentSong()
        {
            player = new MusicPlayer(mediaDb, soundDb);
            mediaDb.OpenConnection();

            player.LoadSongs("to");

            mediaDb.CloseConnection();
            player.Play();

            //Jag hade tänkt att hämta defaultSong från musicplayer, men det gick ej då det strider mot Interfacet.
            //Antog att det inte var okej att lägga till en property där, därav upprepningen.

            string actual = player.NowPlaying();

            player.Stop();
            Assert.AreNotEqual(defaultSong, actual, "Tystnad ska ej råda");
        }